php - 请问用哪个字符串函数截取下面字符串最后两项并转换为数组?
阿神
阿神 2017-04-10 16:13:38
0
3
621

请问用哪个函数将下面的字符串截取后面两项并转换为数组?

$week = "Monday,Tuesday,Wednesay,Thursday,Friday,Saturday,Sunday";

?>

阿神
阿神

闭关修行中......

reply all (3)
左手右手慢动作
$result = array_splice( explode(',', $week), -2 ); var_dump($result);
    PHPzhong

    先分割成数组 然后用array_splice取数组的后两个元素

      大家讲道理

      split(分割符):根据分割字符,把字符串拆分成数组

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!