PHP Chinese string Intercepting program code

1. Intercept GB2312 Chinese string The code is as follows Copy Code Intercepting Chinese stringsfunction Mysubstr ($str, $start, $len) {$tmpstr = ""; $strlen = $start + $len;for ($i = 0; $i if (Ord (substr ($str, $i, 1))

PHP strlen and Mb_strlen judge string is pure English/pure Chinese/English mixed

Using the differences between the above characters and the English language, we can use the Mb_strlen function and the strlen function to calculate two sets of length numbers, and then do the operation according to the law to determine the type of

PHP Application Tools

After taking part in several large PHP projects and writing a lot of PHP code, I found that many tools can improve code quality and simplify publishing, making the career of PHP developers a lot easier. Many of these tools may have been used for

A summary of two methods of Linux installation configuration PHP environment

1. Get installation files: http://www.php.net/downloads.php php-5.3.8.tar.gz To obtain the support files needed to install PHP: http://download.111cn.net/download/netlong339/1351852 libxml2-2.6.32.tar.gz 2. Install LIBXML2 The code is

Examples of PHP's serialize serialization data and JSON formatted data

PHP's serialize is to serialize the variable, returning a string expression with variable type and structure, while JSON is a lighter and friendlier format for interface (AJAX, rest, and so on) data interchange. In fact, both are in a string of ways

Mac configuration php54+php via MacPorts fpm+nginx+mysql5.5

Using MacPorts to configure the PHP development environment (php54+php FPM+NGINX+MYSQL55), you first need to install port, Access: http://www.macports.org/install.php, download the source code directly:

The three-group function summary I confused in PHP (htmlentities,html_entity_decode,addslashes)

I. htmlentities () and Htmlspecialchars () 1, Htmlentities () 1.1 Features: Converts characters to HTML entities. Characters include ASCII entities and ISO 8859-1 entities (HTML entity tables: http://www.w3school.com.cn/tags/html_ref_entities.html) 1

The php mail function sends an email with attachments)

(Attachments can be included. The code is as follows:Copy code Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> php mail function sends an email with attachments // You might need to change this line, if you do not use// The default

Php determines whether the user's browser type is WeChat browser

PHP method: Use the "_ SERVER" array "HTTP_USER_AGENT" of PHP to obtain the information of the user agent on the page to complete this work. The code is as follows:Copy code Echo $ _ SERVER ["HTTP_USER_AGENT"];?> [Winows/chrome] output

Php simple website traffic statistics program (source, search engine, ip, keyword)

Traffic Statistics tools, such as cnzz, Baidu Statistics, and 51, are both very good and powerful. I wrote a simple traffic statistics tool, but I can only count the access time, visitor ip address, access route, and access page, from seo/seo.html

In centos, php Curl cannot access https. ssl_version is NSS rather than openssl.

First, determine whether php has installed extension curl and openssl. If not, skip this step...View phpinfo. If curl is found, the curl 7.19.7 libcurl/7.19.7 NSS/3.19.1 Basic ECC (instead of openssl) will be found)Because centos 6.5 (the version I

The difference between single quotes and double quotes in PHP is described in detail.

1. Define a stringIn PHP, you can use single quotes or double quotes to define strings. However, the same single or double quotation marks must be used to define strings. For example, 'hello' and 'hello' are invalid strings.When defining a string,

Php readdir function usage and readdir instance

Definition and usageThe readdir () function returns the entries in the directory handle opened by opendir (). If yes, the function returns a file name; otherwise, false.Instance 1*/$ Dir = "readdir /";// Determine whether it is a directoryIf (is_dir

Php entry: strrchr instance tutorial

Php entry: strrchr instance tutorialDefinition and usageThe strrchr () function determines the position where another string occurs and returns all characters starting from this position to end the string.If the character cannot be found, this

Php supports gb2312, uft-8 Chinese and English character truncation function

Php Tutorial support gb2312, uft-8 Chinese and English character truncation function// Intercept the gb2312 Chinese stringFunction mysubstr ($ str, $ start, $ len ){$ Tmps tutorial tr = "";$ Strlen = $ start + $ len;For ($ I = 0; $ I If (ord (substr

Common php regular expressions (1/9)

1. Use the ereg function.2. Usage example of the eregi () function.3. Replace the matched string.4. Replace the matching string with eregi_repalce.5. Use the function split ().6. Use the split () function.7. The SQL _regcase () function generates a

PHP timestamp function (several minutes, several hours ago, several days ago, etc)

1. The PHP timestamp function converts a date to a unix timestamp.Doomsday timestamp PHP The code is as follows: Copy code Echo "doomsday timestamp:". strtotime ("2012-12-21 ")

WebQQ web page hash Encryption Algorithm PHP version

Due to the recent severe mass mailing of QQ junk information, the official team chose to detail the implementation of some WebQQ functions. The POST value obtained from friends has an additional hash parameter.This hash is encrypted in js.Below is

Create a multi-level directory in php

Example The code is as follows:Copy code Function mkdirs ($ dir ){If (! Is_dir ($ dir )){If (! Mkdirs (dirname ($ dir ))){Return FALSE;        }If (! Mkdir ($ dir, 0777 )){Return FALSE;        }    }Return TRUE;}$ Path = "/aa/bb/cc/cd"; //

Total Pages: 12780 1 .... 2062 2063 2064 2065 2066 .... 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.