src/Pinyin.php
protected function splitWords($pinyin, $option)
    {
        $split = array_filter(preg_split('/\s+/i', $pinyin));

        if (!$this->hasOption($option, PINYIN_TONE)) {
            foreach ($split as $index => $pinyin) {
                $split[$index] = $this->formatTone($pinyin, $option);
            }
        }

        return array_values($split);
    }
protected function splitWords($pinyin, $option)
    {
        $split = array_filter(preg_split('/\s+/i', $pinyin));

        if (!$this->hasOption($option, PINYIN_TONE)) {
            foreach ($split as $index => $pinyin) {
                $split[$index] = $this->formatTone($pinyin, $option);
            }
        }

        return array_values($split);
    }
protected function splitWords ( $ pinyin , $ option ) { $ split = array_filter ( preg_split ( '/\s+/i' , $ pinyin ) ) ; if ( ! $ this -> hasOption ( $ option , PINYIN_TONE ) ) { foreach ( $ split as $ index => $ pinyin ) { $ split [ $ index ] = $ this -> formatTone ( $ pinyin , $ option ) ; } } return array_values ( $ split ) ; }
Split pinyin string to words.

@param string $pinyin
@param string $option

@return array
Split pinyin string to words .