[KLUG Members] php and quotation marks

bill bill at billtron.com
Tue Sep 27 14:46:17 EDT 2005


On Tue, 2005-09-27 at 14:30, Richard Harding wrote:

> 
> My version would look like:
> print '<p align="center">The name is ' . $myvariable . '</p>';
> 
> The variable stands out cleanly from the non-php. I have no problems
> with ' this way. Just personal preference, but I thought I would share. 

O.K., but what would this look like?

echo "<tr><td>$name</td><td>$date</td><td>$status</td><td>$r</td></tr>";

You'd end up with 

print  '<tr><td>' . $name . '</td><td>' . $date . '</td><td>' . $status
. '</td><td>' . $r . '</td></tr>";

After a while, concantenation becomes too long and unreadable.  The
first line is simpler.

kind regards,

bill



More information about the Members mailing list