Replace the characters "ia" in the string with "eo":
The strtr() function translates certain characters in a string.
Note: If the from and to parameters are different in length, both will be formatted to the length of the shortest.
or
| 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 |
| array | Required (unless to and from is used). An array containing what to change from as key, and what to change to as value |
| Return Value: | Returns the translated string. If the array parameter contains a key which is an empty string (""), it will return FALSE. |
|---|---|
| PHP Version: | 4+ |
Replace the string "Hello world" with "Hi earth":
Complete PHP String Reference
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The HTML5 Certificate documents your knowledge of advanced HTML5.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
Your message has been sent to W3Schools.