只匹配第一个
<a href="javascript:void(0);" id="js_name">禾葡兰</a>
public function get_time(){
$regex="/<a (.*?) id=\"js_name\">(.*?)<\/a>/is";
$return = file_get_contents('https://mp.weixin.qq.com/s/ZX5j3V1W3L6UykSVyfoASg');
preg_match($regex, $return, $matches);
print_r($matches);
}
匹配全部
$regex=tideTable\;
preg_match_all($regex, $return, $matches)
print_r($matches);
public function get_time(){
$regex='/var ct="(\d+)"/';
$str = 'var ct="1531288854"*1';
preg_match($regex, $str, $matches);
print_r($matches);
}