strtr() function converts all characters contained in destination to their corresponding character matches in source. : strstr « String « PHP






strtr() function converts all characters contained in destination to their corresponding character matches in source.

 
Its syntax: string strtr (string string, string source, string destination)

<?
    $source = array("<title>" => "<h1>", "</title>" => "</h1>");
    $string = "<h1>Today In PHP-Powered News</h1>";
    print strtr($string, $source);
?>
  
  








Related examples in the same category

1.string strstr ( string haystack, string needle ) finds the first occurrence of a substring inside another string (parameter one)
2.strstr function demo
3.strstr() function returns the remainder of string beginning at the first occurrence.
4.strstr.php
5.strtr.php