List Info

Thread: note 78100 added to language.references




note 78100 added to language.references
user name
2007-09-27 12:52:10
<?

$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  -- h
ttps://master.php.net/note/delete/78100/integrated
Del: useless     -- http
s://master.php.net/note/delete/78100/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/78100/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78100
Reject      -- https://mast
er.php.net/note/reject/78100
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )