This article describes these functions you probably know, have used, but there are some small points you may not notice, and the development will also use these points, when you use, you can think of these PHP function features, then you not only development efficiency, and code quality is high. Here I'll show you some of these functions:
Array_diff: Compare value only, and the key value remains the same.
ARRAY_DIFF_ASSOC: not only compares value, but also compares the key value, and the result key value is reordered
Array_diff_key ($array 1, $array 2, $array 3 ...) : includes all values that appear in the array1 but do not appear in any other parameter array, and in the last parameter you can also customize a function
strip_tags ($str, ' <p> '): strip HTML tags, but keep img and p tags
In_array (): The function adds a true to the third parameter to avoid data format conversions to improve performance.
str_replace (Array (' 1 ', ' 2 '), Array (' A ', ' B '), $STR):both Str_replace and Preg_match can be passed as an array
Array_slice (array,offset,length, Preserve): The fourth argument retains the key name if true, otherwise the index is sorted from the new one
Array_search (value,array):php return key, PHP gives a value, return the array corresponding to the value of the key, return only one, will not continue to look down
Array_keys: also returns a key value, but if more than one key value is returned
@mkdir ($dir, 0777,true): The third value is true to recursively create a directory
The functions and methods in PHP are mutable (for frames). $a (); $obj $a ();
Some of the features of PHP functions you may not know