Hi,
More of a theoretical question than anything else, is it possible to do the following, and if so, any pointers on how it works.
function myFunction($myArray) {
return $value;
}
myArray = Array(1,2,3,4,5,6)
while($tmp = myFunction($myArray)) {
echo $tmp;
}
So basically, like mysql_fetch_array works, where by it loops each record at a time and returns one record until the end of the recordset is reached, but instead of a recordset identified, passing in an array.
Now before everyone starts 🙂 I know I can use foreach(), I'm not interested in the correct way to loop an array, I'm more interested in the theory behind the principle.
Thanks for any discussion.
Andrew