➤ The strtr() function translates certain characters in a string. Syntax:
strtr(string,from,to)
For instance:
// Replace the characters "1p" in the string with "lr":
$string = "He11o wopld";
$result_string = strtr ($string,"1p","lr");
echo $result_string;
• If the from and to parameters are different in length, both will be formatted to the length of the shortest.
by Levani Makhareishvili
2 years ago
PHP
Function
1
Pro tip: use ```triple backticks around text``` to write in code fences