Using preg_grep, how would you search for an exact match of a variable? I was able to get the following code to return anything containing those letters, but can't seem to get only exact match.
$o is an array $a for example would be "at"
$c=preg_grep("/$a/",$o);
echo implode($c, ' ');
And the output would be something like: at cat hat mat
Using logic from bash grep I thought I could use ^\$a$ but apparently isn't correct. Any ideas?