php使用正则表达式匹配string
$contents=”【该商品已经被查询过,本次是第66次查询, 上次查询日期:2015-3-2 21:34:04,谨防假冒】”;
$pattern = ‘/([0-9]){2}/’;
preg_match($pattern, $contents, $match);
print_r($match);
输出内容为Array( [0] => 66 [1] => 6)
我们这个是为了取出第几次查询 66 次
$contents=”【该商品已经被查询过,本次是第66次查询, 上次查询日期:2015-3-2 21:34:04,谨防假冒】”;
$pattern = ‘/([0-9]){2}/’;
preg_match($pattern, $contents, $match);
print_r($match);
输出内容为Array( [0] => 66 [1] => 6)
我们这个是为了取出第几次查询 66 次