Why is this php program wrong. PHPcode $ s2 & quot; make_by_id & quot; echoconvString ($ s1); functionconvString ($ string) {$ arrayexplode (_, $ string); array_walk ($ array, & quot; uc: Why is an error in this php program.
PHP code
$s2 = "make_by_id";echo convString($s1);function convString($string){ $array = explode('_', $string); array_walk($array, "ucwords"); return implode('', $array);}
---------------------------------------------
Warning: Wrong parameter count for ucwords () in E: \ wwwroot \ webtest \ test. php on line 25
------ Solution --------------------
PHP code
$ Arr2 = explode ('_', $ s2); function self_ucwords (& $ p_a, $ p_ B) // you can specify two or three parameters, for more details, see the manual {$ p_a = ucwords ($ p_a); // A parameter} array_walk ($ arr2, 'Self _ ucword'); echo implode ('', $ arr2 );
------ Solution --------------------
$ Array = explode ('_', $ string );
Array_walk ($ array, "ucwords ");
$ Add multiple $ array = array () before array ();