note 53980 deleted from language.basic-syntax by betz
| From: | betz@php.net | Date: | Sun, 03 Jul 2005 08:12:45 +0000 |
| Subject: | note 53980 deleted from language.basic-syntax by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91338@lists.php.net to get a copy of this message | ||
Note Submitter: mfyahya at gmail dot com
----
I came across this slightly weird behaviour when embedding php inside html comment tags
<!-- start comment
<? for ($i=0; $i<3; $i++) ?>
end comment -->
<? echo 'blah'; ?>
will output:
<!-- comment
end comment -->
blah
ie you won't get 'end comment -->' or even 'blah' printed 3 times as you
might expect
but if you do
<!-- start comment
<? for ($i=0; $i<3; $i++) { ?>
end comment -->
<? echo 'blah'; } ?>
you'll get:
end comment -->
blahend comment -->
blahend comment -->
blah
which isn't what you probably want either