1.
htmlspecialchars("<script>alert('sdfsdf');</script>");将脚本语言转换为html代码,防止脚本运行。
2. 该函数是将文本中回车变为<br>将空格变为
function htmtocode($content){
$content=str_replace("/n","<br>",str_replace(" "," ",$content));
return $content;
}
3.获取IP地址
$ip = gethostbyname('www.baidu.com');
$iipp=
tiny_mce_marker
SERVER["REMOTE_ADDR"];4.常用类中函数
function __autoload($class_n){
//自动载入进当前页面
include($class_n.".php");
}
function __tostring(){
return "这是个什么样的类";
}
function __call($function,$array_v)
{
echo "不存在方法为:".$function."<br>";
echo "错误的值:".print_r($array_v);
}
function __clone(){
echo "nidelei";
}
function __destruct(){
echo "清理一个对象";
}
5.......