【发布时间】:2015-10-26 07:25:11
【问题描述】:
我正在尝试从此字符串中获取“内容”:
$string = "start start content end";
像这样使用 preg_match:
preg_match('/start(.*?)end/', $string, $matches);
echo $match[1];
但是,问题是$matches[1] 返回start content 不仅是content,因为$string 中有两个start(可能还有更多)
如何仅获得content 部分和preg_match?
【问题讨论】:
标签: php regex preg-match