Home  >  Article  >  Backend Development  >  php通过explode()和list()函数实现字符串的截取

php通过explode()和list()函数实现字符串的截取

WBOY
WBOYOriginal
2016-06-20 12:50:231109browse

php代码段:

$str = "23-qwewwuioakoji"; //这里分别要截取以“-”分隔的前后两个不定长的字符串list($number, $random) = explode("-", $str);echo $number;echo $random;

output:

    23

    qwewwuioakoji

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn