"hi", "hi" => "hello");echo"/> "hi", "hi" => "hello");echo">

Home  >  Article  >  Backend Development  >  炒炒冷饭。该如何处理

炒炒冷饭。该如何处理

WBOY
WBOYOriginal
2016-06-13 10:09:02807browse

炒炒冷饭。
我上次看见有人用str_replace 替换是可以写成数组的,,给点资料,连接来看看吧



------解决方案--------------------
$trans = array("hello" => "hi", "hi" => "hello");
echo strtr("hi all, I said hello", $trans);


hello all, I said hi
 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn