if (preg_match('/^([0-9]( |-)?)?(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$/', $buffer, $matches));
{
$variable = ?;
}
views:
51answers:
1
+1
A:
see: http://php.net/manual/en/function.preg-match.php
In your case the $matches array holds what you are looking for. It is always a good idea to check the documentation first. Especially for something documented well.
ghills
2010-05-14 00:31:19