Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Run each array element in a user-defined function:
SUBMITTED BY:
henry1874w
DATE:
June 26, 2017, 5:04 p.m.
FORMAT:
Text only
SIZE:
217 Bytes
Raw
Download
Tweet
HITS:
216
Go to comments
Report
<?php
function myfunction($value,$key)
{
echo "The key $key has the value $value<br>";
}
$a1=array("a"=>"red","b"=>"green");
$a2=array($a1,"1"=>"blue","2"=>"yellow");
array_walk_recursive($a2,"myfunction");
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus