Here we talk about the PHP operation symbol of the upgrade version: ++,--, hehe.
+ + is the self increase,
-that is, self reduction.
Practical application:
$a = 10; $a + + =? First use the Plus, the final result is 11.
$a = 10; + + $a =?
0.in_array commonly used methods of use
The code is as follows
Copy Code
$nameslist = Array ("Small skin", "small Xuan Xuan", "works to", "cute little Trade");if ("In_array", $nameslist)){echo "Find it";}Else{echo "Do
。 The following is an example for updating statistics:
$ (' #stats '). Load (' stats.html ');This code, as if it were only executed once, I now want to implement real-time data updates, such as statistics online number
$.post ('
The code is as follows:Copy code Function htmtocode ($ content ){$ Content = str_replace ("n", "", str_replace ("", "", $ content ));Return $ content;} Replace spaces and press enter.Equivalent: The code is as follows:Copy code Function
Php Tutorial functions call_user_func and call_user_func_arrayThe call_user_func function is similar to a special method for calling a function. The usage is as follows:Function a ($ B, $ c){Echo $ B;Echo $ c;}Call_user_func ('a, "111", "222 ");Call_
Definition and usageMysql tutorial _ field_type() Specifies the field type in the returned result set of the function.If the operation succeeds, the type of the specified field is returned. If the operation fails, false is returned.SyntaxDescription
Substr (str, start, length );Example: substr ('php tutorial is very good language );Output is ve;If the length of start> str is returned ();Substr ('php is very good language );Substr ('php is very good language ', 4 );Output as (blank)Output is v
_ Wakeup1. _ call_ Call ($ method, $ arg_array) when an undefined method is calledA special method _ call () is added to the object in php Tutorial 5, which is used to monitor otherMethod. If you try to call a method that does not exist in an object,
If you are the first to verify the mailbox, if you want to obtain the article or string to check whether there is a mailbox address, you can use the second one.*/Function funcemail ($ str) // email regular expression{Return (preg_match ('/^ [_. 0-9a-
The filter_sanitize_number_int filter deletes all invalid characters in the number.This filter allows all numbers and + -.*/$ Number = "5-2 + 3 pp ";Var_dump (filter_var ($ number, filter_sanitize_number_int ));/*Verification Number: ^ [0-9] *
If (! Extension_loaded ('gd ')){// If not loaded, perform the load operationIf (! Dl ('gd. So ')) {// If loading fails, all operations are terminated.Echo "gd library loading failed ";Exit; }}
If yes, true is returned. Otherwise, false is returned. If the directory fails to be switched, the php Tutorial will also issue a warning.SyntaxFtp_chdir (ftp_connection, directory) parameter descriptionFtp_connection is required. Specifies the ftp
Definition and usageThe chop () function removes white spaces or other predefined characters from the end of a string.The alias of the rtrim () function of the function.SyntaxChop (string, charlist)*/$ Str = "I'm a teacher"; // define a string$
Definition and usageThe header () function sends the original http header to the client.It is important to realize that the header () function must be called before any actual output is sent (in php 4 and later versions, you can use the output cache
The function used to check the length of the array in php is sizeof count. Check a simple instance */$ Colorlist = array ("apple" => "red", "grass" => "green", "sky" => "blue ", "night" => "black", "wall" => "white ");Echo "array length:". count ($
The code is as follows:Copy code // Delete the folder and all its filesFunction deldir ($ dir ){$ Dh = opendir ($ dir ); While ($ file = readdir ($ dh )){ If ($ file! = "." & $ File! = ".."){ $ Fullpath = $ dir. "/". $ file; If (! Is_dir (
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