strtr

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, ...

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.