时间:2021-07-01 10:21:17 帮助过:18人阅读
$week = "Monday,Tuesday,Wednesay,Thursday,Friday,Saturday,Sunday";
?>
请问用哪个函数将下面的字符串截取后面两项并转换为数组?
$week = "Monday,Tuesday,Wednesay,Thursday,Friday,Saturday,Sunday";
?>
$result = array_splice( explode(',', $week), -2 );
var_dump($result);
先分割成数组 然后用array_splice取数组的后两个元素