Question: Using php and js. There is no setInterval in php so I cant do for(i=0.....) How do I set it so that it will loop

Using php and js. There is no setInterval in php so I cant do for(i=0.....) How do I set it so that it will loop through each line every 5 seconds in the div with id of news?

__________________________________________

news.txt:

(line1) ab

(line2) cd

(Line3) kfkrfkfv

...

________________________

$handle = fopen("news.txt", "r");

if ($handle) {

while (($line = fgets($handle)) !== false) {

$cart[] = $line;

}

fclose($handle);

} else {

// error opening the file.

}

?>

News Headline

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!