I have this regex:
preg_match_all('/{.*?}/', $html, $matches);
Which returns all strings that are written inside curly braces. The $matches variable contains the { and } characters also. How can I remove them?
I don't want to do:
if ($matches[0] == "{variable}")
And I don't want to add ( and ) characters to the regexp because I don't want to use:
preg_match_all('/{(.*?)}/', $html, $matches);
if ($matches[0][0] == "variable")
So is there a simpler way to remove the curly braces from the $matches within the regex?