That's because preg_match returns true on match, false on not match, if you assign it to a variable. The 3rd argument is where it assigns what it matched. Coincidentally, that's where I put $match.
One of the great things about the php manual is that you can do for instance, http://www.php.net/preg_match and it will take you straight to the manual entry for the function. And one of the great things about the manual is that it tells you all kinds of neat things like what functions there are, what they do, how to use them, etc... it's a revolutionary concept that I hope catches on, because of its superb usefulness.