Answer the question
In order to leave comments, you need to log in
Why doesn't recursion work in PHP?
Hello.
There is this code:
$i = 0;
function func($arr) {
$keys = array_keys($arr);
echo $arr[$keys[$i]];
$i++;
if($i <= count($keys)){
func($arr);
}
}
func(['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question