PHP - Arrays
What will be the output of the following PHP code?
$arr = [3 => 'apple', 1 => 'banana', 2 => 'cherry']; sort($arr); print_r($arr);
$arr = [3 => 'apple', 1 => 'banana', 2 => 'cherry']; sort($arr); print_r($arr);
sort() sorts values ascending and resets keys starting from 0.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions