PHP regular matches the Chinese in the string

We need to understand first.Chinese Double-byte character encoding range 1. GBK (gb2312/gb18030)X00-xff GBK Two-byte coding rangex20-x7f ASCIIXa1-xff Chinese gb2312X80-xff Chinese GBK 2. UTF-8 (Unicode) U4e00-u9fa5 (Chinese)x3130-x318f (KoreanXAC0

PHP page-type

Prohibit direct access to this pageif (basename ($HTTP _server_vars[' php_self ']) = = "pager.class.php") {Header ("http/1.0 404 Not Found");} Class Pager{Total information of/** * *var $infoCount;/** Total Pages * *var $pageCount;/** per-page

Directory management functions for PHP

ChDir: Change the directory.Dir: Catalog Category class.Closedir: Close directory handle.Opendir: Open Directory handle.Readdir: Read directory handle.Rewinddir: Reset directory handle. ChDirChange the directory.Syntax: int chdir (string

Through the PHP program to know whether spiders visit your website (with code)

Search engine spiders visit the site through the remote crawl page to do, we can not use the JS code to obtain the spider agent information, but we can through the image tag, so we can get the spider agent data, through the agent data analysis, you

Implementation of multilevel tree menu with PHP

Tree-type directory structure template programMenu Directory Gallery Field Description:MENU_ID menu item IDMenu NameMenu_grade Menu Level 1 Main Menu 2 is level two menu ...Menu_superior Top level Menu ID number function My_menu ($menu _content, $i,

PHP $ _post Function and $_get function

PHP Tutorials $ _post function and $_get function 1, get is from the server to obtain data, post is to send data to the server; 2. Get adds the data in the form, in the form of Variable=value, to the URL that the action points to, and both uses

PHP Jquery.ajax No Refresh login Simple instance Code

A very simple application example, the use of Jquery.ajax to achieve no refresh login effect, convenient very simple, the example also only said the jquery application of this masonry, PHP tutorial that paragraph did not say, there is a need for

PHP multidimensional array sorting and Operation function

PHP tutorials Multidimensional array sorting and Operation functionsfunction ARRAYCD ($arr) {Static $res _arr=array ();if (Is_array ($arr)){foreach ($arr as $key => $val){if (Is_array ($val)){ARRAYCD ($val);}else{$res _arr[]= $val;}}}elseif

PHP Chinese processing skills

chr

function Unicode_urldecode ($url){Preg_match_all ('/%u ([: Alnum:]]{4})/', $url, $a);foreach ($a [1] as $uniord){$dec = Hexdec ($uniord);$utf = ';if ($dec {$utf = Chr ($DEC);}else if ($dec {$utf = Chr (($dec-($dec% 64))/64);$utf. = chr (128 + ($dec%

PHP Mailbox Regular Expression

? if ($_post){if (Funcemail ($_post[' url ')){Echo ' Valid email address ';}Else (Funccard ($_post[' url ')){Exit (' Please enter the correct email address ');}} ?> "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >php-Mailbox Regular

PHP Detection file Directory size class

This code from PHP dedecms Oh, think it this test file size is better, so do not post it out Oh, share it with you. Class Spaceuse{var $totalsize = 0;function Checksize ($indir){$DH =dir ($indir);while ($filename = $dh->read ()){if (!ereg ("^.",

PHP read Sogourank and Chinarank information

Function Sogourank ($domain) {   $rank = ';   $PR = 0;   $content = get_content (' Http://ww W.sogou.com/web?query= '. $domain);  if (Preg_match ("/ ([0-9]{1,}) /", $content, $matches))  {    $PR = Intval ($matches [1]);    $width = ceil (65* $

PHP mysql_field_type () function

Definition and usageMysql tutorial _ field_type() Specifies the field type in the returned result set of the function.If the operation succeeds, the type of the specified field is returned. If the operation fails, false is returned.SyntaxDescription

Php substr (), explode (), strrev ()

Substr (str, start, length );Example: substr ('php tutorial is very good language );Output is ve;If the length of start> str is returned ();Substr ('php is very good language );Substr ('php is very good language ', 4 );Output as (blank)Output is v

Function for obtaining the IP address of the host name protocol in php

*/$ Hostname = gethostbyaddr ($ _ server ['remote _ addr ']); // Obtain the host nameEcho $ hostname; // output result//$ Hosts = gethostbynamel ('localhost'); // obtain the IP address listPrint_r ($ hosts); // output array//$ Protocol = 'tcp '; //

Usage of the ftp_chdir () ftp_cdup () function in php

If yes, true is returned. Otherwise, false is returned. If the directory fails to be switched, the php Tutorial will also issue a warning.SyntaxFtp_chdir (ftp_connection, directory) parameter descriptionFtp_connection is required. Specifies the ftp

Php stream_context_create function

Function prototype: resource stream_context_create ([array $ options [, array $ params])View instances// Define the options array$ Opts = array('Http' => array  ('Method' => "get ",'Header' => "accept-language: enrn". "cookie: foo = barrn"  ));//

Common socket instances in php

Code Extension to obtain remote host socket information */Function getpeername (){$ Remote_ip = $ remote_port = 0; // defines the ip address.Socket_getpeername ($ this-> fd, $ remote_ip, $ remote_port); // return host informationReturn array ($

Php character comparison function similar_text strnatcmp strcasecmp

The similar_text () function calculates the number of matching characters for two strings.This function can also calculate the similarity between two strings (expressed in percentages ).SyntaxSimilar_text (string1, string2, percent)Note: The

Introduction to parse_url () function usage in php

A useful function in PHP, parse_url, is particularly convenient for information capture analysis. For example: The code is as follows:Copy code $ Url = "http://www.111cn.net/aaaa/"; $ parts = parse_url ($ url );Output:Array([Scheme] => http[Host]

Total Pages: 12780 1 .... 12119 12120 12121 12122 12123 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.