code is as follows
copy code
/* Call Tencent's API interface return result var ipdata = new Array ("114.238.55.147", "", "Jiangsu province", "Huaian"); 0 for IP address 1 for Null 2 is the province 3 is the city */
The code is as follows
Copy Code
if (Preg_match_all ("/http://[^")]+[.jpg|. Gif|. Jpeg|. Png]+/ui ", Stripcslashes ($content), $aliurl)) {$i = 0; Multiple files + +while (the list ($key, $v) = each ($aliurl [0])) {echo $v. "
The following one is to determine whether the domain name entered is legal, and then the http,https,ftp for processing, analysis and send
function _scan_url (){$req = $this->_url;$pos = Strpos ($req, '://');$this->_protocol = Strtolower (substr
Common php functionsStrstr (string, string) // truncate from the place where a string appears for the first time to the endStrrchr (string, string) // captures a string from its last position to its end.Strpos (string, string [, int]) // position
The index. php file is shown in the following figure. The code is as follows:Copy code Header ("Content-type: text/html; charset = GBK"); // output encoding to avoid Chinese garbled characters?> ajax paging demonstration $ Page = isset ($ _ GET [
Directly run the code:The following example shows how to delete the html of a specified directory. If you want other files, you only need to change the html to the suffix you want to delete. The code is as follows:Copy code $ Lanmu = array
Core code The code is as follows:Copy code $ T1 = microtime (true );//... Execute the code...$ T2 = microtime (true );Echo 'elapsed Time'. round ($ t2-$ t1, 3). 'Second '; The core code above is described in detail below The code is as follows:
1. Do not judge the total length. You can add the total length;2. Supports domain name suffixes such as .net.cn and .com.cn;3. The mailbox name must start with a letter or number and can contain "-" and "_" in the middle;4. The domain name must
Array_slice () The first parameter is the array to be cut, the second parameter is the starting position, and the third parameter is the length.It is to cut the $ arr array and count it three times from 0th elements. The code is as follows:Copy
Array sorting methodThere are two types:1. Internal (memory) sorting2. External sorting (large data volume, insufficient memory, externalStorage)----------------Sorting is a basic skill for programmers.I. Internal sorting(1) exchange sorting1.
I recently encountered code conversion problems in writing bbs. After searching for a long time, we can get a perfect solution to completely restore the author's original article.The following post is for your correction.System: linux php4 oracle8i//
1. PHP and ASPASP is actually not a language. It is just the abbreviation of Active Server Pages. The syntax used in ASP is actually a script version of Visual Basic. The biggest drawback is that ASP was born on Microsoft's Internet Information
Function validate ($ value, $ onoff = 0, $ type = 3, $ len = 100, $ msg = 'fill in error '){If (trim ($ value )! = "") {// If there is any contentIf (! Is_int ($ len ))Exit (" ");Preg_match_all ("/[xa0-xff]?. /", $ Value, $ arr); // mix Chinese and
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