Section 14th-Namespaces
Naming variables, functions, and classes is difficult, except to take into account the name of the variable to be easy to understand, but also to worry about whether the name has been used elsewhere. In a short script, the
The Filter_validate_float filter validates the value as a floating-point number.
*/
$var = 12.3;
Var_dump (Filter_var ($var, filter_validate_float));
Float (12.3)
/*Non-negative floating-point number (positive floating point + 0): ^d+ (. d+)?
The Preg_match () function in PHP is a common function used to perform regular expressions, so let me give you a detailed introduction to Preg_match usage.
function usage
int Preg_match_all (string pattern, string subject, array matches [, int flags]
PHP original Str_replace function is to replace all, if we want to replace only once, can refer to the following implementation program to solve.
The Str_replace () function replaces some other characters in a string with a
PHP uses Json_decode to force JSON data to convert to an array of simple application example reference documents, we take advantage of Var_dump (Json_decode ($str, true)); We're going to convert the JSON into the data we want.
The code
curl_setopt function is an important function in PHP, it can imitate the user's behavior, such as imitating the user login, registration and so on some user-operable behavior Oh.
BOOL curl_setopt (int ch, string option, mixed value)
The curl_setopt (
Because Flock () requires a file pointer, you may have to use a special lock file to protect access to the files that you intend to open through write mode (add "w" or "w+" in the fopen () function).
Because Flock () requires a file pointer, you may
First Test whether the MAGIC_QUOTES_GPC is on, if it is, Array_map () to return the original escaped data, whether to turn on the automatic addslashes function as long as we look at the php.ini in the KO or with Get_magic_quotes_ GPC () function to
This article is introduced in PHP comes with a truncated string function, can only handle English, the number can not intercept the Chinese mixed, oh, there is a need for friends to reference, the latter is more useful, the first is mainly for
This article specifically introduces the detailed usage of the Array_slice function and some commonly used array_slice instance programs, which can be seen by the students who need to know.
The Array_slice () function takes a value out of the array
Here are two efficient classical methods to delete array elements, we can specify the deletion of the delete, the need for students can refer to, here from Php.net Oh.
The code is as follows
Copy Code
phpfunction
When we use textarea, we will find that the carriage return and the space are not visible, so we use the Str_replace function to replace the \ n in PHP to BR is OK. If you need a friend, you can refer to it.
The code is as follows
The use of functions for Session_unset () and Session_destroy () is described.
Session_unset ()Frees all $_session variables that are currently created in memory, but does not delete the session file and does not release the corresponding sessionId
Var_export--Output or return a string representation of a variable
Describe
Mixed var_export (mixed expression [, bool return])
This function returns the structure information about the variable passed to the function, similar to Var_dump (),
Definition and usage
MySQL Tutorial _field_typeThe () function returns the type of the specified field in the result set.
If successful, returns the type of the specified field, or False if it fails.
GrammarMysql_field_type (data,field_offset)
Running an external program in PHP that only the root user can run is always an old problem, and it's hard to do it in a regular way. This is because PHP is generally a module of Apache, that is, PHP is part of Apache, and Apache, in addition to the
Considerations for Call_user_func functions
Parse Error:syntax error, unexpected t_list, expecting t_string in
This is a question that has been prompted today when using this function. See also the official manual does not describe the precautions
The function of the Opendir () is to open a directory handle.
If the function runs successfully, a set of directory streams (a set of directory strings) is returned, and if failure returns an error [ERROR]. You can hide the error by adding "@" to
in PHP mb_substr () function is used to intercept the Chinese and English functions, you can quickly solve the problem of intercepting the length of the specified characters, let me introduce to you.
Hint: MB_SUBSTR is in PHP is not supported by
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