获取字符串中的字符问题

WBOY
Release: 2016-06-23 13:50:33
Original
870 people have browsed it

例如我想获取"10t2"当中的10和2两个字符
用了strstr()函数,把T也截取出来了,
这个要怎么获取呢?


回复讨论(解决方案)

$str='10t2';$a=substr($str,0,2);  //10$b=substr($str,3,1);  //2
Copy after login
Copy after login

$str='10t2';$a=substr($str,0,2);  //10$b=substr($str,3,1);  //2
Copy after login
Copy after login


你这样只能找一个字符串的,我有很多类似的字符串,数字都不是一样的,我找到方法了,还是谢谢你!
Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!