PHP preg_match() Function

PHP preg_match() Function


This function searches string for pattern, returns true if pattern exists, otherwise returns false. Usually search starts from beginning of subject string. The optional parameter offset is used to specify the position from where to start the search.

Syntax:

int preg_match( $pattern, $input, $matches, $flags, $offset )

Parameters: This function accepts five parameters as mentioned above and described below: