I'm trying to make the script wait 3 seconds before continuing to executing. The problem is the sleep function gets ran first and sleeps for 3 seconds, and after that both the loops gets ran.
if ($resultCheck > 0) {
while ($row = mysqli_fetch_all($result)) {
for ($i=0; $i < 3; $i++) {
echo $row[$i][0];
}
sleep(3);
$values = sizeof($row);
for ($i=3; $i < $values; $i++) {
echo $row[$i][0];
}
}
}