September 2001
Intermediate to advanced
768 pages
32h 45m
English
string ereg_replace(string pattern, string replacement, string subject)
| pattern | Regex pattern to match |
| replacement | Replacement string |
| subject | String to search using the pattern |
Performs POSIX regular expression match and replaces the matches in the subject with the specified replacement.
Returns:
Modified string if the pattern matched; unmodified string if not
Description:
This function replaces any matches for the pattern with a replacement in a specified subject string. The entire string is searched for the pattern and all the matches are replaced. This allows a global search and replace to be done quickly and easily.
The replacement string can contain references of the form \n , where n is a number from 0 to 9. Before the ...
Read now
Unlock full access