2011年10月20日

PHP中的 strtr 函数

摘要: PHP的 strtr 函数, 性能要比 str_replace 函数高, 可以代替 str_replace 来使用.strtr 有两种形式:string strtr ( string $str , string $from , string $to )string strtr ( string $str , array $replace_pairs )当使用第一种的时候, 参数 $from, $to 的字符串长度一定要相同, 否则多余的(不管是$from多还是$to多) 字符被忽略.比如 $str = 'a-=b' ;当$from='-=' ,$to=' 阅读全文

posted @ 2011-10-20 14:26 还是刀哥靠谱 阅读(1516) 评论(1) 推荐(0) 编辑

导航