On 2004-01-22, Juha Suni <juha.suni@ilmiantajat.fi> wrote:[color=blue]
> jm wrote:[color=green]
>> Thanks. Actually, I found that I had to separate the string on three
>> different lines:
>>
>> so, for example:
>>
>> echo "<td id=";
>> echo $parent_id;
>> echo ">";
>>
>> then it would print. Bizarre. I used to run into these quirks with
>> ASP (classic) too.[/color]
>
> Cleaner and faster to write would be just to do
> echo "<td id=" . $parent_id . ">";
>
> Or even for more performance (although not noticeable):
> echo '<td id=' . $parent_id . '>';
>
> And finally, to avoid html-problems if the $parent_id happens to contain
> spaces (you never can be too sure), do:
>
> echo '<td id="' . $parent_id . '">';[/color]
As what html concerns, values of an attribute must be put between " " or
' '. Thus <td id='value'> is valid too.
Oh and the last option echo "<td id='{$parent_id}'/>";
--
http://home.mysth.be/~timvw