Bytes -----------------------------------------------------------------------------------------
Let's take an example to illustrate the key points.
$ A = true;
Echo $ a ++;
Echo $ a + 1;
$ B = 'C ';
Echo $ B ++;
Echo $ B ++;
-----------------
Whether writing JavaScript or PHP, you are always used to using single quotes. However, if you encounter a problem during coding at home over the weekend, you need to use PHP to filter the line breaks in the string and follow these steps:
$ Out =
Although the latest PHP 5.4 supports JSON Chinese encoding, it uses the JSON_UNESCAPED_UNICODE parameter, for example:
Json_encode ("Chinese", JSON_UNESCAPED_UNICODE) for earlier PHP versions, the processing does not escape the json encoding of
PHP uses curl to determine whether a remote file exists. See the following code:
// Determine the Remote File
Function check_remote_file_exists ($ url)
{
$ Curl = curl_init ($ url );
// Do not retrieve data
Curl_setopt ($ curl, CURLOPT_NOBODY,
Turn: https://www.centos.bz/2011/03/auto-run-task-crontab/
Our PHP program sometimes needs timed execution. We can use the ignore_user_abort function or place js on the page to help us implement it. However, both methods are unreliable and unstable.
First, how to differentiate the front-end when using jQuery:
When jQuery sends an ajax request, a message named X-Requested-With is added to the request header. The message content is XMLHttpRequest.
You can use $ _ SERVER ["HTTP_X_REQUESTED_WITH"]
1. upload_file.php
// Obtain the extension of the uploaded image and the randomly generated file name.
Header ("content-type: text/html; charset = UTF-8 ");
/**
* Get the file extension
* Enter description here...
*@ ParamUnknown_type $ filename
*
PHP obtains the previous prev and next tag values of any subscript key in the array.
$ Value) {$ steps-> add ($ key) ;}$ steps-> setCurrent (3); // The parameter is the key value echo 'previous Subscript :'. $ steps-> getPrev ().""; Echo
Explode: Method for Finding whether a character explode (stringseparator, stringstring [, intlimit]) the separator is a null string (& quot;), and explode () returns
Explode
Explode (string separator, string [, int limit])
The separator is a null
A: Like variable naming, built-in function names and numbers cannot be used to name function B: repeated calls. C: static element D: is supported: non-fixed parameters are supported.
A: Like naming variables, you cannot use built-in function names
Phpserialize and unserialize syntax serialize --------- format the array into an ordered string unserialize (php3 & gt; 305, php4) unserializ
Php serialize and unserialize syntax
Serialize --------- format the array into an ordered
The difference between the two functions has always been vague. I only know that mysql_fetch_assooc () can remove duplicate values in the result set. in actual applications, mysql_fetch_assoc () is generally used (), today I thought of the two
The strtr () function converts the special character syntax of a string: strtr (string, from, to) or strtr (string, array) * $ addrstrtr ($ addr, & quot; & quot;, & quot; aao & quot;); first caller
The strtr () function converts special characters
There are many types of string comparison, the most basic is to determine whether to be equal, and use strcmp to compare the size of the string function. the following examples illustrate the comparison between string and simple characters.
There
This function is more useful for data collection. Generally, you need to specify the content of a region when collecting data. this code can be used as an example: $ str & quot; & lt ;! -- Fdaf ---- & gt; & quot; echostrip_comments ($ str); f
This
The str_replace ($ arr1, $ arr2, $ str) instance has the following code: str_replace (& quot; iwind & quot ;, & quot; kiki & quot;, & quot; iloveiwind, iwin
The most efficient and simplest character replacement function in php is str_replace ($ arr1,
Check data type php function set: check the data type to determine whether the detected type belongs to the check type. If yes, the system returns TRUE. Otherwise, the system returns false. the detection data type is defined as follows:
Check the
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