April 2026
Intermediate
1009 pages
34h 15m
English
This section provides an overview of the various functions and possibilities for regular expressions in PHP.
The simplest way to check a regular expression is with the function preg_match(RegEx, String). The first parameter is the regular expression; the second parameter is the string to which it is to be applied.
The function returns 1 if the regular expression matches—that is, was found in the string—and 0 if not.
false, a truth value, is only returned by preg_match() in the event of an error. In this respect, you should exercise caution when checking the return. It is best to use strict equality with ===.
The regular expression must be enclosed in two identical simple ...
Read now
Unlock full access