Q:

Write a PHP script to delay the program execution for the given number of seconds

0

Write a PHP script to delay the program execution for the given number of seconds.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
// current time
  echo date('h:i:s') . "\n";
  // sleep for 5 seconds
  sleep(5);
  // wake up
  echo date('h:i:s')."\n";
?>

Sample Output:

02:47:42                                                            
02:47:47

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now