September 2001
Intermediate to advanced
768 pages
32h 45m
English
Original form:
string strtr(string string, string find, string replace)
Alternate form (PHP 4+ only):
string strtr(string string, array map)
| string | String to operate on |
| map | Associative array of 'find' => 'replace' mappings |
Replaces all occurrences of find within string with replace.
Returns:
String; FALSE on error
Description:
strtr() is used to translate sets of substrings within a string to another set of substrings. If the find and replace arguments are specified, each character in string that occurs in find is replaced with the corresponding character in replace . The find and replace strings should be of equal length—if they’re not, the additional characters in the longest string are ignored.
If the map argument is used instead, ...
Read now
Unlock full access