I'm having some issue in creating a script. So basically I do need to create a code that executes a function, waits x seconds and executes a second.
P.S: the 2 functions show a text via echo.
So what I did is that I did use sleep between the 2 functions. The problem is that when I do load the page, the loading bar of the browser keeps loading till the sleep(x) is finished, which I don't want to because it prevents the other content of the page (html, css) to load.
My code looks like this
execute_function1();
sleep(10);
execute_function2();
So I was wondering if there's any other way to create something like this, without using sleep. So all the content I do have on the site (html, css) can load even if there's some waiting between the 2 PHP functions.
Thank you in advance!
Stay safe!