preg_match returns identical elements only once
问题 I am going through a string and proces all the elements between !-- and --!. But only unique elements are processes. When I have !--example--! and a bit further in the text also !--example--!, the second one is ignored. This is the code: while ($do = preg_match("/!--(.*?)--!/", $formtext, $matches)){ I know about preg_match_all, but need to do this with preg_match. Any help? Thanks in advance! 回答1: You'll want PHP to look for matches only after the previous match. For that, you'll need to