I have a few lines of codes that will convert array values to uppercase. This work fine on my local development server using PHP 5.6, however it fails using PHP 7.0. What is causing it to fail?
function make_uppercase(&$word) {
$word = strtoupper ( $word );
return $word;
}
$fish = array (
"hampala ampalong",
"hampala macrolipedota"
);
print_r ( array_filter ( $fish, "make_uppercase" ) );
You should write this. This will solve your problem
function make_uppercase(&$word) {
$word = strtoupper ( $word );
return $word;
}
$fish = array (
"hampala ampalong",
"hampala macrolipedota"
);
print_r ( array_map ( "make_uppercase", $fish ) );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With