How to use strtr in PHP

In this article I will explain how strtr function can be used in PHP.
  • 1437

strtr() function

This function translates certain characters in a string.

Syntax

strtr(string,from,to)

Example

<html>
<body>
<?php
echo strtr("Rekmn Bmnrdwaj","mn","ha");
?>
</body>
</html>

 

Output


strtr-php.jpg

You may also want to read these related articles Click here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.