Copyright 2014 by igooseo

html2

hàm delay trong php

10:41 By Chuyên mục: , No comments
1.Hàm sleep :
int sleep ( int $seconds );

Examples:

<?php

// current time
echo date('h:i:s') . "\n";

// sleep for 10 seconds
sleep(10);

// wake up !
echo date('h:i:s') . "\n";

?>
tham khảo thêm ở PHP Manual :http://php.net/manual/en/function.sleep.php
2.Hàm usleep :
 
void usleep ( int $micro_seconds );
 
Example:
<?php

// Current time
echo date('h:i:s') . "\n";

// wait for 2 seconds
usleep(2000000);

// back!
echo date('h:i:s') . "\n";

?>
tham khảo thêm ở PHP Manual :http://php.net/manual/en/function.usleep.php

Không có nhận xét nào: