找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 php教程 查看内容

php简单正则有关问题

作者:模板之家 2020-10-31 15:17 140人关注

php简单正则问题?php$timestamp='2012年02月0315:06:46';preg_match_all("/(.*?)年(.*?)/is",$timestamp,$rarr,PREG_SET_ORDER),php简单正则有关问题

php简单正则问题

$timestamp = '2012年02月03 15:06:46';
preg_match_all("/(.*?)年(.*?)/is", $timestamp, $rarr, PREG_SET_ORDER);
print_r($rarr);

preg_match_all("/(.*?)年(.*?)月(.*?) (.*?):(.*?):(.*?)/is", $timestamp, $rarr, PREG_SET_ORDER);
print_r($rarr);
?>


以上代码结尾的那个值总取不到,比如第一个只取到年,取不到月,请问应该如何修改呢?
原作者: 互联网 来自: 网络收集

全部回复(0)