I have a text that has multiple occurrences of variables in this format:
Example text will %%include%% these %%parameters%%
I’m trying to use this:
preg_match('/%%[\s\S]*?%%/i',$output, $matches);
But for some reason I’m getting only the first match, any ideas?
Use preg_match_all because you need multiple matches.