$content = "<!-- layout::public:index::30 -->";
$find = preg_match_all("/<!-- layout::(.+?)::(.+?) -->/is",$content,$matches);
if($find) {
var_dump($matches);
}
---------- php ----------
array(3) {
[0]=>
array(1) {
[0]=>
string(33) "<!-- layout::public:index::30 -->"
}
[1]=>
array(1) {
[0]=>
string(12) "public:index"
}
[2]=>
array(1) {
[0]=>
string(2) "30"
}
}
输出完成 (耗时 0 秒) - 正常终止
转载于:https://www.cnblogs.com/phpfans/archive/2011/10/08/2202362.html