note 78100 added to language.references
| From: | rmaj at osu1 dot php dot net | Date: | Thu, 27 Sep 2007 17:52:10 +0000 |
| Subject: | note 78100 added to language.references | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130857@lists.php.net to get a copy of this message | ||
<?
$a = array("a"=>"111", "b"=>"222",
"c"=>"333");
foreach ($a as $ix => $val) {
$ref = &$a[$ix];
$ref = $val . '_changed';
}
foreach ($a as $ix => $val) echo "$val ";
// 111_changed 222_changed 333_changed
?>
is a simply way to change elements of array witohut retyping $array_name[$index] all the time
----
Server IP: 212.47.220.13
Probable Submitter: 213.35.236.252
----
Manual Page -- http://www.php.net/manual/en/language.references.php
Edit -- https://master.php.net/note/edit/78100
Del: integrated -- https://master.php.net/note/delete/78100/integrated
Del: useless -- https://master.php.net/note/delete/78100/useless
Del: bad code -- https://master.php.net/note/delete/78100/bad+code
Del: spam -- https://master.php.net/note/delete/78100/spam
Del: non-english -- https://master.php.net/note/delete/78100/non-english
Del: in docs -- https://master.php.net/note/delete/78100/in+docs
Del: other reasons-- https://master.php.net/note/delete/78100
Reject -- https://master.php.net/note/reject/78100
Search -- https://master.php.net/manage/user-notes.php