汇成软件 Create the world!!!

php替换函数--数组写法

<?php 

$my_name='&&&&';

//echo  substr(xml_entities($my_name),0,135);
ECHO xml_entities($my_name);


function xml_entities($string) {
    return strtr(
        $string, 
        array(
            "<" => "",
            ">" => "",
            '"' => "",
            "'" => "",
            "&" => "",
            "|" => "",
            "-" => "",
            "–" => "",
            ":" => "",
            "Ⅱ" => "2",
            
        )
    );
}
 ?>


作者:admin 分类:php 浏览:594 评论:0
留言列表
发表评论
来宾的头像