preg_match_all vs. preg_match

Can anyone explain to me the difference between preg_match and preg_match_all? What situations would preg_match_all be used instead of preg_match?

Thanks for your help!

preg_match stops looking after the first match. preg_match_all, on the other hand, continues to look until it finishes processing the entire string. If all you need is the first match (or if you know there will always be only one match to your pattern), then preg_match is the one you should use; if you want multiple matches returned, use preg_match_all.

Ok thanks