Search Results
strtr (PHP 4, PHP 5, PHP 7, PHP 8) strtr — Translate characters or replace substrings
- Sprintf
Sprintf - PHP: strtr - Manual
- Printf
Printf - PHP: strtr - Manual
- Fprintf
Parameters ¶ stream A file system pointer resource that is...
- Vsprintf
Vsprintf - PHP: strtr - Manual
- Vfprintf
Parameters ¶ stream format The format string is composed of...
- Bin2hex
Convert binary data into hexadecimal representation
- Htmlspecialchars
Certain characters have special significance in HTML, and...
- Ucfirst
Make a string's first character uppercase
- Sprintf
Definition and Usage 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.
- Required. Specifies the string to translate
Jul 11, 2025 · Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
Learn how to use the PHP strtr function to replace substrings in a string efficiently. Detailed examples and syntax explained.
PHP strtr () Function Topic: PHP String Reference Prev | Next Description The strtr() function translate characters or replace substrings within a string. The following table summarizes the technical details of this function.
- Required. Specifies the string to translate.
- PHP 4+
strtr 15 nov. 2018 21 fois (PHP 4, PHP 5, PHP 7, PHP 8) strtr — Remplace des caractères dans une chaîne
People also ask
What is PHP string strtr() function?
What is strtr() function?
What are the parameters of strtr() function?
What does STR() do in JavaScript?
Parameters string The string being translated. from The string being translated to to. to The string replacing from. replace_pairs The replace_pairs parameter may be used instead of to and from, in which case it's an array in the form array ('from' => 'to', ...). If replace_pairs contains a key which is an empty string (""), the element is ignored; as of PHP 8.0.0 E_WARNING is raised in this case.
