str_replace with array

前端 未结 5 1260
粉色の甜心
粉色の甜心 2020-12-01 23:33

I\'m having some troubles with the PHP function str_replace when using arrays.

I have this message:

$message = strtolower(\"L rzzo rwldd         


        
5条回答
  •  余生分开走
    2020-12-01 23:56

    Easy and better than str_replace:

     "http://www.",
        "w" => "W",
        "d" => "D");
    
        $word = "http://desiweb.ir";
        echo strtr($word,$arr);
    ?>
    

    strtr PHP doc here

提交回复
热议问题