This article describes how to determine whether a number, or a character type, is a method in PHP programming. Refer to a friend who needs it.First, PHP is verifying that the string is a number. Method one: In PHP with regular validation is a number,
This article describes the use of Strtolower and Strtoupper in PHP for case conversion functions, which are often encountered in character handling issues. If you need a friend, refer to it.1, convert the string to the lowercase strtolower function:
/*
* Keyword Matching class
* @author YLX
* @packet Mipang
* Usage Examples
* $str = "green shell layer with Edwin van der Sar next year, next year 1 of the spill room Lucas neighbourhoods";
* $key = new
echo Time (); Return "1264668961"
?>
Copy Code2,date ()The date () function is required to convert the UNIX timestamp to the current time that can be read.The prototype of the date function is as follows:
This article introduces the two functions of removing HTML tags in PHP, the difference between Strip_tags and Htmlspecialchars. Useful to friends, may wish to refer to the next.First, look at the Strip_tags function. Remove the HTML and PHP
/**
* Recursively get files in directories and subdirectories
* by bbs.it-home.org
*/
function Readfilefromdir ($dir) {
if (!is_dir ($dir)) {
return false;
}
Open Directory
$handle =
in this article, PHP receives the data from post, and parses an example of JSON, for everyone to learn the reference. PHP receives the post data, parses the JSON code, uses PHP functions--stripslashes, Json_decode, Var_dump: Code Description:
/*
* Function: Encode the URL
* Parameter description: $web _url website URL, does not contain "http://"
* site:bbs.it-home.org
*/
function Hashurl ($url)
{
$SEED = "Mining PageRank is against GOOGLE's TERMS of
This article describes a powerful PHP cookie operation class, you can set a cookie, get cookie value, delete the cookie value and other operations, the need to refer to a friend.Share a PHP cookie action class that can set cookies, get cookies, and
/**
* Date function to format output time of specified range
* by bbs.it-home.org
*/
$stand = "2013-01-";
for ($i = 1; $i
$time = Strtotime ($stand. $i);
$date [] = Date ("Ymd", $time);
}
Convert URLs to static URLs
function Url_rewrite ($file, $params = Array (), $html = "", $rewrite = True) {
if ($rewrite) {//development phase is not rewrite, where the development of the time, put $rewrite = False
$url = ($file
This article describes the PHP implementation of a simple MySQL tool that may execute multiple SQL statements, with the need for a friend reference.The code is as follows:
";//Resolve not to enter a non-colon without a SQL problem for ($i
This article introduces a PHP implementation of a file download function, you can support the download of a variety of format files. Refer to a friend who needs it.PHP file Download function share, the code is as follows:
404 File Not found!");
/**
* Output CSV header information
* Note: There should be no data output before and after using this function
* @param data downloaded $data the Array
* @param file name downloaded $file _name String
* @edit:
A small example of a PHP math function-bbs.it-home.org
Echo ABS (-1);//Take absolute value function
echo "####### #ceil, floor function ######";
echo ceil (1);//Take the smallest integer greater than the parameter
Print (Date ("L DS of F Y h:i:s A"));
Print ("July 1, is on a". Date ("L", Mktime (0,0,0,7,1,2000)));
?>
Copy CodeExample two:
$tomorrow = Mktime (0,0,0,date ("M"), Date ("D") +1,date ("Y"))
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service