[thelist] PHP - While Loop

Keith Dahlby dahlbyk at softhome.net
Thu Aug 14 11:37:56 CDT 2003


John,

In PHP, variable names are parsed in "-quoted strings.
For example, let $distance = '5 km'.

"<td align='right'>$distance</td>"
    becomes
<td align='right'>5 km</td>

or if you're want to double-quote your HTML attributes:

"<td align=\"right\">$distance</td>"
    becomes
<td align="right">5 km</td>

Note that variables aren't parsed for '-quoted strings:

'<td align="right">$distance</td>'
    becomes
<td align="right">$distance</td>

For more information, see:
http://www.php.net/types.string#language.types.string.parsing

Cheers ~ K

At 10:27 AM 8/14/2003, you wrote:
>Oh, wait, shouldn't that first line also be:
>
>"<tr>\n  <td align='right'>" . $distance. "</td>\n";
>
>Or even:
>
>"<tr>\n  <td align=\"right\">" . $distance. "</td>\n";



More information about the thelist mailing list