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

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

WBOY
Release: 2016-06-20 12:50:23
Original
1176 people have browsed it

php代码段:

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

output:

    23

    qwewwuioakoji

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template