Gb2312 encoding:
CopyCode The Code is as follows: function Unescape ($ Str ){
$ STR = rawurldecode ($ Str );
Preg_match_all ("/% u. {4} |. {4}; | D +; |. +/u", $ STR, $ R );
$ AR = $ R [0];
Foreach ($ Ar as $ k => $ v ){
If (substr ($ V, 0, 2) = "%
The key of the PHP array can be string or integer. If the key is of the float type, it is automatically converted to the integer type.
If a key is not specified for a value and the maximum value of an integer index is provided, the new key is the
This article describes how to clear HTML tags from strings in PHP.
To filter all HTML tags in a string, you can write a function by yourself and use regular expression filtering. The other method is to use the strip_tags function provided by PHP.
CopyCode The Code is as follows :/*------------------*/
//-Recursively implement the infinite classification to generate the drop-down list Function
//-$ TPL-> assign ('sort _ list', createsortoptions ());
//-$ TPL-> assign ('sort _ list',
Let's talk about two methods:
1) define a string variable to save the list of files to be loaded. Then foreach loads.
CopyCode The Code is as follows: $ A = '/a. Class. php;/util/B. Class. php;/util/C. Class. php ';
$ B = '/D. php;/E. Class.
1. Make PHP installationProgramPrinciple In fact, the installation principle of the PHP program is nothing more than importing the database structure and content into the corresponding database, and re-configuring the parameters and files for
Due to the fact that PHP does not support multithreading, Web Crawler Development
Program The efficiency is not high. At this time, you often need to use curl multi functions to implement concurrent multi-threaded access to multiple URL addresses.
The source code is opened, and the line feed method used in the string is "Name: {$ name} \ naddress: {$ adress} \ ncity: {$ city} \ ncountry: {$ country} \ n ......"
Since "\ n" cannot start with a line break, change it to "\ r \ n.
Modify = submit
The main difference is that if the same key name appears in two or more arrays, the key name can be divided into strings or numbers.
1) when the key name is a number, array_merge () will not overwrite the original value, but + merges the array
In addition, when controlling whether the two values are always in the structure, we should try to use = instead of = (of course, this is also appropriate based on the specific business logic ).
Let's explain whyVar_dump (in_array (0, array ('s ')
The + operator appends elements of remaining keys from the right handed array to the left handed, whereas duplicated keys are not overwritten.
I only know this when I read PHP manual again today.
CopyCode The Code is as follows: $ A = array ("A"
When the number of arguments is
Compile a function in PHP. Generally, when calling a function, the changed value is a form parameter rather than a real parameter. However, if an address character is added to the form parameter, the value of the
Float types can be represented in the following types:
CopyCodeThe Code is as follows: $ A = 1.234;
$ B = 1.2e3;
$ C = 7e-10;
?>
When using the float type of PHP, you must note that the float type of PHP is somewhat inaccurate. If you need high-
When I say this, many comments will criticize you: you are wrong, wrong, completely wrong. Okay.
Program Employees must have the communication skills and the ability to work with others. You are not alone in the team! In fact, people will say: it
Integer can be in decimal, octal, or hexadecimal format.
In octal notation, the number must start with 0 (0;
In hexadecimal notation, the number must begin with 0x (Zero X) or 0x (Zero capital X;
Integer Overflow: When an integer overflows, it
Use single quotes instead of double quotes to include strings, which is faster. Because PHP will search for variables in strings enclosed by double quotes, but not in single quotes. Note: Only echo can do this, it is a "function" that can treat
Common Memcache Methods
Memcache: add-add a value. if it already exists, false is returned.Memcache: addServer-add an available server addressMemcache: close-close a Memcache objectMemcache: connect-create a Memcache objectMemcache: debug-control
CURL Library Function in PHP)
Curl_close-close a curl sessionCurl_copy_handle-copy all content and parameters of a curl connection ResourceCurl_errno-A number containing the current session error message is returned.Curl_error-returns a string
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