最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php常用函数
时间:2022-07-02 10:37:16 编辑:袖梨 来源:一聚教程网
function stripslashes_content(&$content) {
if(get_magic_quotes_gpc() == 0) {
$content = str_replace("'","'",$content);
$content = str_replace('-',"-",$content);
$content = str_replace('`',"`",$content);
$content = str_replace('"',""",$content);
$content = str_replace("","\",$content);
}
return $content;
}
function checkNumber($num) {
return ((string)(int)$num === (string)$num ? true : false);
}
function isemail($email) {
return strlen($email) > 6 &&
preg_match("/^[w-.]+@[w-.]+(.w+)+$/", $email);
}
function dhtmlspecialchars($string) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = dhtmlspecialchars($val);
}
} else {
$string =
preg_replace('/&((#(d{3,5}|x[a-fA-F0-9]{4})|[a-zA-Z][a-z0-9]{2,5});)
/', '&1',
str_replace(array('&', '"', '<', '>'), array('&', '"', '<',
'>'), $string));
}
return $string;
}
function getReply($id) {
global $db,$db_tables;
$db->query("SELECT * FROM {$db_tables['repeat']} WHERE id='{$id}'");
$reply = $db->fetch();
if(is_array($reply))
return $reply;
else
return false;
}
相关文章
- 原神玛薇卡恰斯卡队怎么配队 玛薇卡配队大全攻略 07-12
- 光遇水之灵怎么找-水之灵位置攻略 07-12
- 剑星拉毗服装如何获取 拉毗服装获取方式分享 07-12
- 晨会分享朋友圈文案 07-12
- 幻兽帕鲁雷冠龙捕捉位置在哪 帕鲁雷冠龙位置介绍 07-12
- Solana与Bullish达成关键整合,助力稳定币发展 07-12