ereg

string ereg(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 POSIX regular expression match against the specified string.

Returns:

FALSE if no match is found; otherwise, the length of the full match if the matches parameter is specified or 1 if it’s not specified

Description:

Searches a string for a regular expression according to the specified POSIX regex pattern. 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] ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.