Phpexplodesplitstr_split function and instance. In the php Tutorial, the explodesplitstr_split function differs from the three functions of the instance by dividing a string into an array, but each function has its own usage, next, let's take a look at the differences between the explode split str_split function and the instance in the phpexpl php Tutorial.
All three functions split a string into an array, but each has its own usage. let's take a look at the differences between the php explode split str_split function and the instance.
*/
$ Str = "id_99_cn.html ";
$ Array = explode ('_', $ str );
Print_r ($ array );
/*
Array
(
[0] => id
[1] => 99
[2] => cn.html
)
*/
// Function prototype: array split (string $ pattern, string $ string [, int $ limit])
$ Split = split ('_', $ str );
Print_r ($ split );
/*
Array
(
[0] => id
[1] => 99
[2] => cn.html
)
*/
// The str_split () function string is split into an array.
$ Str_split = str_split ($ str, 2 );
Print_r ($ str_split );
/*
Array
(
[0] => id
[1] => _ 9
[2] => 9 _
[3] => cn
[4] =>. h
[5] => tm
[6] => l
)
This site Original article reprinted indicated from http://www.bKjia. c0m
The difference between the explode split str_split function and the three functions of the instance are to split a string into an array, but each has its own usage. Next let's take a look at the php expl...