Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个文本以这种格式多次出现变量:
Example text will %%include%% these %%parameters%%
我正在尝试使用这个:
preg_match('/%%[\s\S]*?%%/i',$output, $matches);
但由于某种原因,我只得到了第一场比赛,有什么想法吗?
使用preg_match_all因为您需要多个匹配项。