请问这个php程式为什么会出错。
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$s2 = "make_by_id";echo convString($s1);function convString($string){ $array = explode('_', $string); array_walk($array, "ucwords"); return implode('', $array);}$arr2 = explode('_', $s2);function self_ucwords(&$p_a, $p_b)//通常传入2参数,也可以3个参数,更详细用法查手册{ $p_a = ucwords($p_a);//一个参数}array_walk($arr2, 'self_ucwords');echo implode('', $arr2);<br><font color="#e78608">------解决方案--------------------</font><br><br><br>$array = explode('_', $string);<br><br>array_walk($array, "ucwords");<br><br><br>$array前加多个$array=array();<div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号