Edit report at http://bugs.php.net/bug.php?id=54802&edit=1

 ID:                 54802
 User updated by:    tobiasoleary at mac dot com
 Reported by:        tobiasoleary at mac dot com
 Summary:            Request for Alternative Syntax Control Structure for
                     foreach
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            Output Control
 Operating System:   Mac OS X
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

Feature has already been added. I was being a dumb dumb.


Previous Comments:
------------------------------------------------------------------------
[2011-05-18 00:01:09] tobiasoleary at mac dot com

Description:
------------
---

>From manual page:
http://www.php.net/control-structures.alternative-syntax

---



Request for Alternative Syntax Control Structure for foreach



I would like to do this:

<ul>

<?php foreach($myarray as $myvalue): ?>

<li><? print $myvalue; ?></li>

<?php endforeach; ?>

</ul>

Test script:
---------------
<ul>

$myarray = array(1, 2, 3);

<?php foreach($myarray as $myvalue): ?>

<li><? print $myvalue; ?></li>

<?php endforeach; ?>

</ul>

Expected result:
----------------
Generate a html list with 3 list items containing the text 1, 2, and 3,


respectively.



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54802&edit=1

Reply via email to