$content = ‘[qlist:i]:[qlist:id]’
preg_match_all('/\[qlist:(.*?)\]/',$content,$arry);
$tag = $arry[0];
$key = $arry[1];
谁能给我解释下这个正则呢 为啥这个0 1 分别表示的是
[qlist:i] 和 i
[qlist:id] 和 id
呢
回复讨论(解决方案) $content = '[qlist:i]:[qlist:id]';preg_match_all('/\[qlist:(.*?)\]/',$content,$arry);print_r($arry);
array( [0] => array 符合 \[qlist:(.*?)\] 的成分 ( [0] => [qlist:i] [1] => [qlist:id] ) [1] => array 第一个圆括号中匹配到的 ( [0] => i [1] => id ))