Remember several PHP basic knowledge points array in 20 seconds: index array: the key of the array is an integer array, starting from 0. Join array: the key of the array is the array index array of the string $ arrarray (I, love, you); join array $ arr0array (apple & gt; apple, yellow & gt; yellow ); foreach traverses the array traversal $ arrarray (remember several basic PHP knowledge points in 20 seconds)
Array:
Index array: the key of the array is an integer array, starting from 0.
Join array: the key of the array is an array of strings.
// Index array $ arr = array ('I', 'Love', 'you'); // associate the array $ arr0 = array ('apple' => "apple ", 'Yellow' => "yellow ");
Foreach traversal array
// Array traversal $ arr = array ("Apple", "yellow"); foreach ($ arr as $ key => $ value) {echo'
Key :'. $ key. 'corresponding value :'. $ value ;}$ arr0 = array ('apple' => "apple", 'yellow' => "yellow"); foreach ($ arr0 as $ key =>$ value) {echo'
Key: '. $ key.', corresponding value: '. $ value ;}
Determine whether a function exists: function_exsits (function name)
Function sayHello () {echo 'hello';} $ test = 'sayhel'; if (function_exsits ($ test) {sayHello ();} // output hello
Constructor: method called when an object is created
Destructor: method called when an object is destroyed
Class Car () {public _ construct () {echo 'object created ';} public _ destruct () {echo 'object destroyed ';}} $ car = new Car ();
Strpos: String search method
$ Str = 'Hello World'; echo strpos ($ str, 'World'); // output 6, starting from 6th bits
Implode: Return value: combines array elements into a string.
$ Arr = array ('ABC', 'defg'); $ arr0 = implode ('', $ arr); print_r ($ arr0); // The result shows abcdefg.
Explode: Return value: the function returns an array composed of strings.
$ Str = "abc, defg"; $ arr = explode (',', $ str); print_r ($ arr); // The result returns an array with two elements: abc and defg
Author: By: Luo Jian Yuan http://blog.csdn.net/sunyuan_software