$p = "/<li>(.*)<\/li>/i";
preg_match_all($p, $str, $matches);
print_r($matches[1]);
preg_match_all($p, $str, $matches);
print_r($matches[1]);
2016-02-01
<?php
$subject = "my email is spark@imooc.com";
$pattern='/\s(\w+@\w+.com)/';
preg_match($pattern,$subject,$str);
print_r($str[1]);
$subject = "my email is spark@imooc.com";
$pattern='/\s(\w+@\w+.com)/';
preg_match($pattern,$subject,$str);
print_r($str[1]);
2016-02-01
$str = 'one two';
$str = preg_replace('/\s+/', ' ', $str);
echo $str; // 结果改变为'one two'
$str = preg_replace('/\s+/', ' ', $str);
echo $str; // 结果改变为'one two'
2016-01-30
文件地址修改为 $filename = '/data/webroot/usercode/resource/test.txt';
可通过
可通过
2016-01-27