|
Posted by Jerry Stuckle on 09/21/06 13:17
Tim Roberts wrote:
> Peter Fox <peterfox@eminent.demon.co.uk.not.this.bit.no.html> wrote:
>
>>Following on from James McIninch's message. . .
>>
>>>Certainly.
>>>
>>><?php for ($i=0; $i<100; ++$i) { ?>
>>>value of $i is <i><?=$i?></i>.
>>><?php } ?>
>>
>>or
>>
>><?php
>> for ($i=0; $i<100; ++$i) {
>> print("<td><font color=red>$i</font></td>\n");
>>}
>>?>
>>
>><?php
>> for ($i=0; $i<100; ++$i) {
>> $s = vsprintf('%3d </font> %4.2f",array($i,$i/7));
>> print("<td><font color=red>$s</td>\n");
>>}
>>?>
>
>
> I've never understood the aversion to the <?= construct in PHP. One of the
> appeals of PHP is that I can write full PHP modules for the processing, and
> HTML with <?= escapes for the presentation side. It's like having a
> built-in templating engine.
>
> If I have to write everything out in PHP code, I might as well use a more
> sopisticated language.
Because it requires short tags to be enabled, which can conflict with
other languages. For instance, xml uses <?xml to indicate an xml block.
And with short tags on, this would be detected as the start of a PHP
statement.
It's why most systems run with short tags disabled.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|