[thelist] php/mysql/html

Simon Willison cs1spw at bath.ac.uk
Mon Aug 4 14:00:32 CDT 2003


Hi Roger,

Monday, August 4, 2003, 7:52:25 PM, you wrote:
> <tr>
> <td>$title</td>
> <td>$category</td>
> <td>$actor_1</td>
> <td>$actor_2</td>
> <td><img src='images/$rating_star.gif'></td>
> </tr>

You need this: <img src='images/{$rating}_star.gif'></td>

The curly braces enforce the fact that $rating is the variable to be
interpolated. The same syntax can be used for accessing array indices,
e.g print "hi, {$user['name']}";

Hope that helps,

Simon
--
http://simon.incutio.com/



More information about the thelist mailing list