I have Problem with my recursion function. I want to wait until text file input change then redirect to new page.
15 line is
$readedData = fread($myfile,filesize("my1.txt"));
this is my function
first();
function first() {
$myfile = fopen("my1.txt", "r") or die("Unable to open file!");
$number = fread($myfile,filesize("my1.txt"));
fclose($myfile);
recursion($number);
}
function recursion($number2) {
$myfile = fopen("my1.txt", "r") or die("Unable to open file!");
$readedData = fread($myfile,filesize("my1.txt"));
echo ($readedData );
fclose($myfile);
if($number2 != $readedData){
return (recursion($readedData));
}
else if($number2 == $readedData){
return(first());
}
}