标签:截取字符串
$kk="每1天/3次-每次200粒"; preg_match_all(‘/\d+/‘,$kk,$kwo); $a=$kwo[0][0]; $b=$kwo[0][1]; $c=$kwo[0][2]; $dd=substr($kk,strrpos($kk,$kwo[0][2])); $preg1= "/[\x{4e00}-\x{9fa5}]+/u"; if(preg_match_all($preg1,$dd,$matches)){ $d=$matches[0][0]; } $arr=$a.‘,‘.$b.‘,‘.$c.‘,‘.$d;
结果:1,3,200,粒
本文出自 “kangjunfei” 博客,谢绝转载!
标签:截取字符串
原文地址:http://kangjunfei.blog.51cto.com/11556647/1937440