I've a problem with preg_match, I want to select all @xxx from the string so I made this
function test ($v)
{
preg_match('/(@[\w]*)/', $v, $matches);
print_r($matches);
}
test("hers is @first and @second");
However the result shows like that
Array ( [0] => @first [1] => @first)
However it should give me an array with the correct found parts like that
Array ( [0] => @first [1] => @second)
But it don't, Thanks for your help.