Php - how to extract a variable from a loop at a certain time


#1

<?php
set_time_limit(0);
for($a=1;$a<=50000;$a++){
for($b=1;$b<=50000;$b++){
if($a==50000 && $b==50000){
echo "($a;$b)";
}
}
}
?>
this code eventually prints (50000;50000)
but since it takes so long, I wanted it to print the temporary value of a every 5 seconds, so I have an idea of how long it will take to print the final pair. Is there any way to do that in php? I searched for progressbar in php, but I didn't find anything practical or that solves my problem. I hope you have understood my question. Thanks in advance for willing to help.