September 2001
Intermediate to advanced
768 pages
32h 45m
English
int preg_match(string pattern, string subject, [array matches])
| pattern | Regex pattern to match |
| subject | String to search using the pattern |
| matches | Array in which to store the search results |
Performs the regular expression match against the specified string.
Returns:
1 if a match is found; 0 otherwise
Description:
This function tries to find the first match for the regular expression pattern in the supplied subject string. If the matches parameter is supplied, it should be a valid variable, such as $matches, since the function forces it to be passed by reference. Existing contents of this variable are overwritten with the results of the successful search. $matches[0] contains the text from the subject string that matched the full ...
Read now
Unlock full access