Are ^$ and $^ in PHP regex the same?

Viewed 271

Why do both of these regexes match successfully?

if(preg_match_all('/$^/m',"",$array))
  echo "Match";

if(preg_match_all('/$^\n$/m',"\n",$array))
  echo "Match";
4 Answers
Related