i want to know how i can do this. lets say i am running a script and the script is creating alot of files and i want the php script to keep checking if the file exists in order to continue with the script.

how can this be done?

im thinking about using a while loop

while(file_exits){
echo run code;
}