in general, it is better to reuse visible content for sending meta-data to search engines, because such has a greater credibility and less likelihood for spam. If you have a very trustworthy domain name / host, then using invisible markup is often accepted by the search engines; there are examples of site using invisible markup that show rich snippets.
However, if you want to use such meta-data that is independent of visible content, it is much better to use the official <meta> and <link> elements for this than to hide the displaying of your elements using style="display:none" or other CSS-based approaches.
Hiding content on the CSS level has the worst reputation from the search engines' point of view, because it is frequently associated with manipulative SEO.
So I would recommend something along the lines of
<meta style="display:none;" itemprop="reviewRating" content="<?php echo $rating; ?>">
--------------------------------------------------------
martin hepp
e-business & web science research group
universitaet der bundeswehr muenchen
e-mail: he...@ebusiness-unibw.org
phone: +49-(0)89-6004-4217
fax: +49-(0)89-6004-4620
www: http://www.unibw.de/ebusiness/ (group)
http://www.heppnetz.de/ (personal)
skype: mfhepp
twitter: mfhepp
Check out GoodRelations for E-Commerce on the Web of Linked Data!
=================================================================
* Project Main Page: http://purl.org/goodrelations/