How do I use preg_match to return an array of all substrings that match (:)?
For example if I have a string that is:
My name is (:name), my dog's name is (:dogname)
I want to use preg_match to return
array("name", "dogname");
I tried using this expression...
preg_match("/\(:(?P<var>\w+)\)/", $string, $temp);
But it only returns the first match.
Can anyone help me?