Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Change an array element's value. (Notice the &$value)
SUBMITTED BY:
henry1874w
DATE:
June 26, 2017, 5:04 p.m.
FORMAT:
Text only
SIZE:
160 Bytes
Raw
Download
Tweet
HITS:
247
Go to comments
Report
<?php
function myfunction(&$value,$key)
{
$value="yellow";
}
$a=array("a"=>"red","b"=>"green","c"=>"blue");
array_walk($a,"myfunction");
print_r($a);
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus