Customizing Physical Appearance of Strings

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TomGeorge
Forum Newbie
Posts: 8
Joined: Fri Jan 17, 2003 5:56 am

Customizing Physical Appearance of Strings

Post 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)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
TomGeorge
Forum Newbie
Posts: 8
Joined: Fri Jan 17, 2003 5:56 am

Yep it works!

Post by TomGeorge »

That works a treat, you are a star! Thanks very much!

Tom George
tl.george@virgin.net 8)
Post Reply