具有多个长度的str_split()

时间:2018-12-13 13:14:25

标签: php

我搜索了类似str_split之类的东西,但是只有几分之一。例如:

$str = "Hello Friend";
$arr1 = str_split_custom($str, array(2, 3, 7));
print_r($arr1);

结果将是

Array
(
    [0] => He
    [1] => llo
    [2] =>  Friend
)

0 个答案:

没有答案