Definition
The strtr() function translates certain characters in a string.
Syntax
strtr(string, from, to)
Parameters
Parameter | Description |
---|---|
string |
Required. Specifies the string to translate. |
from |
Required (unless array is used). Specifies what characters to change. |
to |
Required (unless array is used). Specifies what characters to change into. |
Example
<?php
echo strtr("Welcome to PIP", "I", "H");