Strpos returns the position where string A first appears in string B (the return result is A number)
In contrast, the PHP string function is the final position of string A in string B returned by strrpos (the return result is A number)
Addcslashes adds a backslash (") to the front of a specified character, for example, echo addcslashes ($ string," Y, O "); // in the specified character" Y, O "followed by a backslash""
Addslashes adds the backslash ("") special character before a specific character in the string to single quotation marks, double quotation marks, null, and backslash ("").
Strstr obtains the substring from the first occurrence of string A in string B to the end of string B.
Strrchr obtains the substring from the last occurrence of string A in string B to the end of string B.
The array_push function is used to add the specified value to the end of the array $ array = array ("0" => "Ming", "1" => "day "); array_push ($ array, "technology ");
Print_r ($ array); the running result is array ([0] => tomorrow [1] => day [2] => technology );
The opposite PHP string function is array_unshift, which is used to add the specified value to the starting position of the array.
The array_pop function returns the last element of an array. The opposite function is the array_shift function, which returns the first element of an array.
The array_unique function is used to delete duplicate values in a specified array and return a new array.
The array_merge function is used to combine multiple numbers and return a new array.
The array_slice function is used to extract array elements of the specified length from the specified position of the array and save the extracted elements to the new array. For example, $ array = array ("I ", "Yes", "Hu", "Rain", "Xuan ");
$ Array1 = array_slice ($ array, 2, 3 );
The value of $ array1 is "Hu Yuxuan"
In contrast, the PHP string function is the array_splice function used to delete array elements from the specified position of the array and save the deleted elements to the new array.