note 50956 deleted from control-structures.foreach by nlopess
| From: | nlopess@php.net | Date: | Tue, 15 Mar 2005 14:47:07 +0000 |
| Subject: | note 50956 deleted from control-structures.foreach by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-86480@lists.php.net to get a copy of this message | ||
Note Submitter: justchecking at nospamsamIam dot com
----
is there an ampersand where there should not be before the $value in your example ...
<?php
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
$value = $value * 2;
}
// $arr is now array(2, 4, 6, 8)
?>