Among the many predefined SERVER variables in PHP, $ _ SERVER [REQUEST_URI] is frequently used, but this variable is only supported by apache. therefore, we need a more general method to obtain the value of REQUEST_URI.
Among the many predefined
When I use the iconv function to convert gb2312 to UTF-8, why do some Chinese characters have problems ??; The following message is displayed: Notice: iconv () [functioniconv]: Detectedanil.
When I use the iconv function to convert gb2312 to UTF-8,
When I used the curl function for data collection, I found that Calltoundefinedfunctioncurl_init was incorrect. later, I learned from the official website that curl is not a function enabled by php by default.
When I used the curl function for data
You can use ini_set to quickly modify the phpini configuration settings. you do not need to open phpini, especially when you do not modify the permission of phpini on the VM, you will find this function
You can use ini_set to quickly modify php. ini
Yesterday I used the file_get_contents function directly when I was doing a simple collection function. However, some websites were okay to collect some network chips. later I analyzed that garbled code was enabled by the server.
Yesterday I used
First, let's take a look at the file_get_contents () function. the official introduction says it reads the entire file into a string. example: & lt ;? Phpechofile_get_contents (& quot; testtxt & quot ;);? & Gt; output: T
Let's take a look at the
& Lt ;? * | A simple counter * functionget_hitcount ($ counter_file) {* returns the counter to zero. if the counter is not used, the initial value is 1. you can also set the initial value
/*
| A simple counter
*/
Function
Several character truncation functions are provided for us in php, including substr, mb_substr, and mb_strcut functions. some php beginners use substr to intercept Chinese characters and find Chinese characters contain garbled characters, we can use
If PHP55 is used in a linux system, you may find that json_encode cannot be called after PHP55 is installed and upgraded to PHP55. this is not a version issue, but it is an incorrect operation. Solution
If PHP5.5 is used in a linux system, you may
Two php string truncation functions are provided. they can automatically recognize Chinese characters. if you are intercepting an article, this is a good one. if you like it, come and check it out. Article 1: & lt ;? Phpheader (& quot;
This article introduces two functions: one is to verify the IP address and the other is to obtain the real IP address of the user. it is also commonly used two IP operation functions to obtain the real IP address of the user. the code is as follows:
The js escape function is often used to convert Chinese characters. but how can I use php to convert the converted characters in js? now I have found two useful functions. GB2312
The js escape function is often used to convert Chinese characters.
This article describes the character replacement functions of two php instances for beginners. one is str_ireplace () and the other is substr_replace (). both functions are easy to use. For more information, see.
This article tells php beginners
This article has collected a lot of methods to remove html tags. many friends may think of using the strip_tags function, but this function will delete all html tags. next I will
This article has collected a lot of methods for removing html tags.
In php, two common functions are used to split strings: chunk_split and explode. There is also a str_split function. here is the example. Define and use the chunk_split () function
In php, two common functions are used to split strings: chunk_split
This function converts the URL and E-mail address strings into clickable superlinks. Code: functionmakeClickableLinks ($ text) {$ texteregi_replace (& amp; 39; (f
This function converts the URL and e-mail address strings into clickable superlinks.
Php trim space has Related function trime. it can remove two spaces or use the ltrim and rtrim functions to directly return the same result as trim. if you want to delete all spaces, use str_replace to replace them.
Php has a trime function for
In php, empty (), is_null (), and isset () functions can be used to determine whether a variable exists. in this case, empty (), is_null (), isset () where are the differences, such
In php, empty (), is_null (), and isset () functions can be used to
In php, functions such as sprintf, ceil, floor, and round are used to perform rounding. let's take a look at the specific instance. This article uses php
In php, functions such as sprintf, ceil, floor, and round are used to perform rounding. let's
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