pastebin

replase
  1. <?php
  2. function replase($str) {
  3.     $replacement = array(
  4.         "phone" => "Телефон", "site" => "Сайт", "Email" => "Email"
  5.     );
  6.    
  7.     foreach($replacement as $key=>$value) {
  8.         $str = mb_eregi_replace($key,$value,$str);
  9.     }
  10.    
  11.     $str = mb_eregi_replace('[{"}]','',$str);
  12.    
  13.     return $str;
  14. }
  15.  
  16. echo replase('{"phone", "email"}');
  17.  
  18.  
  19. ?>
Parsed in 0.021 seconds