Can php language divide two characters?
This article mainly shows you "can php language be divided into two characters?" the content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "can php language be divided into two characters?"
Php can split characters, the method is: 1, through the explode function to achieve a string to split another string; 2, through the str_split function to split the string into the array.
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
Can php split two characters?
Php can split characters:
Explode (): use one string to split another string
Str_split (): splits strings into arrays
The explode () function splits one string into another and returns an array of strings.
Note: the "separator" parameter cannot be an empty string.
Note: this function is binary safe.
Grammar
Explode (separator,string,limit)
Separator is required. Specifies where to split the string.
String is required. The string to split.
Limit is optional. Specifies the number of array elements returned.
Possible values:
Greater than 0-returns an array containing up to limit elements less than 0-returns an array containing all elements except the last-limit element 0-is treated as 1 and returns an array containing one element
The str_split () function splits the string into an array.
Grammar
Str_split (string,length)
String is required. Specifies the string to be split.
Length is optional. Specifies the length of each array element. The default is 1.
The above is all the content of the article "can php language be divided into two characters?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!