找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 php教程 查看内容

关于array_walk的有关问题

作者:模板之家 2020-10-31 15:17 131人关注

关于array_walk的问题?php$fruits=array("d"="lemon","a"="apple","b"="banana","c"="orange");functiontest_alter($item1,$,关于array_walk的有关问题 ...

关于array_walk的问题
$fruits = array("d"=>"lemon","a"=>"apple","b"=>"banana","c"=>"orange");
function test_alter(&$item1,$key,$prefix)
{
$item1 = "$prefix:$item1";
}
function test_print($item2,$key)
{
echo "$key.$item2
 \n";
}
echo "Before.....\n";
array_walk($fruits, 'test_print');
array_walk($fruits, 'test_alter','fruit');
echo "...and after:\n";
array_walk($fruits,'test_print');
?>
关于这段代码的 最后几行的遍历 表示理解不能  求大大们帮我细细的分析一下 让我理解~
原作者: 互联网 来自: 网络收集

全部回复(0)