Page 1 of 1

Customizing Physical Appearance of Strings

Posted: Fri Jan 17, 2003 5:56 am
by TomGeorge
Hi guys,

I am relatively new to PHP, and I am trying to customize the appearance of strings which are got from a MySQL table. I have tried something like:-

print "<tr><td><font face="Verdana">";
print $row["hours"];
print "</font></td><td>";

As well as inserting classes defined in my CSS Sheet, but it gives me a "T_STRING PARSE ERROR"... Can anyone help at all?

Many Thanks,

Tom George
tl.george@virgin.net 8)

Posted: Fri Jan 17, 2003 6:35 am
by twigletmac
Have a look at this:
http://www.php.net/manual/en/language.types.string.php

Basically you need to change what you have to either:

Code: Select all

print '<tr><td><font face="Verdana">'; 
print $row['hours']; 
print '</font></td><td>';
and use single quotes to contain your strings or escape the double quotes within the HTML:

Code: Select all

print "<tr><td><font face="Verdana">"; 
print $row["hours"]; 
print "</font></td><td>";
Mac

Yep it works!

Posted: Fri Jan 17, 2003 7:11 am
by TomGeorge
That works a treat, you are a star! Thanks very much!

Tom George
tl.george@virgin.net 8)