I want to fetch data from database and show the result in codeigniter view with delay.
My code looks like this :
function loadPage($data) {
for($i = 0; $i < count($data); $i++) {
$this->load->view('mypage', $data[$i]);
sleep(5);
}
}
But this only load page once and show all data. What I need is load page with $data[0]
, delay 5 secs, load page with $data[1]
, and so on.
Please advice. Thank You.
Edit :
I want to do this with php. Not javascript or jquery.