Name

strtr

Synopsis

string strtr(string string, string from, string to)
string strtr(string string, array replacements)

When given three arguments, returns a string created by translating in string every occurrence of a character in from to the character in to with the same position. When given two arguments, returns a string created by translating occurrences of the keys in replacements in string with the corresponding values in replacements.

Get Programming PHP, 3rd Edition 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.