I have a string that is formatted like the following:
... {{word1}} {{word2}} .... etc
I need to extract all the words, located inside the '{{' and '}}' tags.
What is the most efficient way to retrieve the words from the string in PHP?
Using pattern /\{\{(\w+)\}\}/
you can extract all the words
preg_match_all("/\{\{(\w+)\}\}/", $str, $matches);
print_r($matches[1]);