note 126613 added to control-structures.alternative-syntax
| From: | johannes dot kingma at gmail dot com | Date: | Mon, 15 Nov 2021 13:56:32 +0000 |
| Subject: | note 126613 added to control-structures.alternative-syntax | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217250@lists.php.net to get a copy of this message | ||
The alternative control syntax can be combined elegantly with the short php notation <?- =>
for output where both blend in into the html code
<ul>
<?php for($counter=0; $counter<10; $counter++) :?>
<li id="itm-<?=$counter?>">Item <?=$counter?>
<?php endfor;?>
</ul>
(Btw. ommiting the </li> is perfectly legal)
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 83.97.87.182)
----
Manual Page -- https://php.net/manual/en/control-structures.alternative-syntax.php
Edit -- https://main.php.net/note/edit/126613
Del: integrated -- https://main.php.net/note/delete/126613/integrated
Del: useless -- https://main.php.net/note/delete/126613/useless
Del: bad code -- https://main.php.net/note/delete/126613/bad+code
Del: spam -- https://main.php.net/note/delete/126613/spam
Del: non-english -- https://main.php.net/note/delete/126613/non-english
Del: in docs -- https://main.php.net/note/delete/126613/in+docs
Del: other reasons-- https://main.php.net/note/delete/126613
Reject -- https://main.php.net/note/reject/126613
Search -- https://main.php.net/manage/user-notes.php