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.......