Hi, I am trying to read a folder that contains images. The images are read into an array. The problem is when I attempt to call the function, (myfunction) in the code, the $x variable will not increment and sets back to 1 everytime it calls the function..😕
I use a do while loop to call the function as long as the $x is <50. The images will print 4 accross as I want them to, but they repeat the same 4 images because the $x is not incrementing.. Does this has something to do with calling functions that kills variables?
Thanks for any help on this.. My code is below: (shortened from original)
<?php
$x=1;
function picReload()
{
++$x;
echo $x;
do
{
sleep(2);
picReload();
}
while ($x<50);
}
picReload();
?>