This article provides a comprehensive introduction to the usage of var_dump () functions in php. For more information, see. Var_dump () voidvar_dump (mixedexpression [, mix this article will give you a comprehensive introduction to the usage of
This tutorial mainly describes how to obtain the domain name of a url from a string. let's take a look. Hope to help me. For example, http: wwwphpfensicom obtains wwwphpfensicom.
This tutorial mainly describes how to obtain the domain name of a url
Boolin_array (mixedneedle, arrayhaystack [, boolstrict]) searches for needle in haystack. If yes, TRUE is returned. otherwise
Bool in_array (mixed needle, array haystack [, bool strict])
Search for needle in haystack. If yes, TRUE is returned.
The default encoding is gb2312. according to my statistics, 90% of the code is gb2312. Therefore, my detection function cannot appear originally gb2312. The basic idea of utf8 is:
Function utf8_gb2312 ($ str, $ default = 'gb2312 ')
{
$ Str =
When you need to convert some data from utf8, cp1251 (window-1251) or cp1251 to utf8 you must use the system function iconv. Common host service providers do not allow this function. The following is a php custom UTF8 and cp1251 function:
When you
We use a url encoding function in php to solve the problem. The method is as follows: & lt ;? Php $ interest & quot; arts & quot; $ homepage & quot; http: wwwphpfensicom & quot; $ query & quot; homepag
We use a url encoding function in php to solve
Use the iconv function: iconv (& quot; UTF-8 & quot;, & quot; gb2312 & quot;, & quot; abc Sunshine 123 & quot;); it is said that this is better, errors during conversion can be ignored! Iconv (& quot; UTF-8 & quot;, & quot; gb2312ignore & quot;
Use
The iconv function is used to convert the captured UTF-8 encoded page into gb2312. it is found that only the iconv function can be used to convert the captured data into less data for no reason.
The iconv function is used to convert the captured UTF-
Function name: ReplaceSpacialChar ($ C_char) function: special character replacement function parameter: $ C_char (string to be replaced) return value: string remarks: This function is faulty,
Function name: ReplaceSpacialChar ($ C_char)
Usage:
This function is powerful. it is much more powerful than the built-in functions in php. This function can automatically obtain your character encoding and convert it to the encoding you want based on your reference, the code is as follows:
This
Today, a customer needs to generate 400 phone numbers in batches at the starting position of 10000. at the beginning, I directly generate a number such as 10004, but merchants do not like this number, here, we can use substr ($ str,-1) 4 to filter
Because the Chinese character is two bytes, it cannot use substr () in the same way as the English and numbers. Fortunately, there is a mb_substr () function in php to handle this problem.
Because the Chinese character is two bytes, it cannot use
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
In php, the file_get_contents function can directly collect remote server content and save it to a variable. Generally, I/O operations such as file_get_contents and fsockopen are involved.
In php, the file_get_contents function can directly collect
In PHP50, simplexml_load_file () is a good function for reading and processing XML files, but garbled characters occur when reading and processing Chinese files. after research, it is found that if it is Chinese content, it must be converted by
The data parsed by the problem is incomplete. there are blank fields. I checked it online and said that there is a bug in php528. the solution is to use a custom function. the code is as follows:
The data parsed by the problem is incomplete. there
& 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
Session usage is actually very simple. it can save the data submitted by the user in the form of a global variable in a session and generate a unique session_id. this is to avoid production when there is more
Session usage is actually very simple.
I wanted to create a function this morning. after logging on to a user, I saved the user's name to the cookie. However, I started to use the method to read the cookie, but it didn't work. later I found that after using setcookie (),
I wanted to
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