PHP searches after a few seconds delay

(*-*)浩
Release: 2023-02-27 08:54:02
Original
2512 people have browsed it

PHP searches after a few seconds delay

#sleep() function delays the execution of the current script for a few seconds.

Note: If the specified number of seconds is negative, this function will throw an error. (Recommended learning: PHP Video Tutorial) The

usleep() function suspends the thread that calls the function for a period of time. The unit is microseconds (millionths of a second).

//usleep()函数

echo date(&#39;h:i:s&#39;) . "<br />";

//延迟 10 描述
usleep(10000000);

//再次开始
echo date(&#39;h:i:s&#39;);

输出显示:
09:23:14
09:23:24

//sleep() 函数

echo date(&#39;h:i:s&#39;) . "<br>";

//sleep for 5 seconds
sleep(5);

//start again
echo date(&#39;h:i:s&#39;);

输出显示:
09:23:14
09:23:19
Copy after login

Simple PHP search

Add the search statement to the initial query statement; thereby simplifying the code

$news_sql = "SELECT * from books where 1=1 ".$searchAddSql." order by book_number ";
Copy after login

$searchAddSql It is empty at first. If the user enters search conditions, $searchAddSql

will become a string containing the query statement.

The above is the detailed content of PHP searches after a few seconds delay. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template