Papipo's function below is usefull in concept but does not work.
"Since you do not pass the array by reference, its pointer is only moved inside the function."
This is true, but the array you are manipulating in your has_next() function will have it's pointer set to the first element, not the same position as the original array. What you want to do is pass the array to the has_next() function via reference. While in the has_next() function, make a copy of the array to work on. Find out the current pointer position of the original array and set the pointer on the working copy of the array to the same element. Then you may test to see if the array has a "next" element.
Try the followig insetad:
<?php
function has_next(&$array)
{
$A_work=$array; //$A_work is a copy of $array but with its internal pointer set to the first element.
$PTR=current($array);
array_set_pointer($A_work, $PTR);
if(is_array($A_work))
{
if(next($A_work)===false)
return false;
else
return true;
}
else
return false;
}
function array_set_pointer(&$array, $value)
{
reset($array);
while($val=current($array))
{
if($val==$value)
break;
next($array);
}
}
?>