PHP头条
热点:

php常用函数


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('&', '"', '<',
'&gt;'), $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;
}

www.phpzy.comtrue/php/29291.htmlTechArticlephp常用函数 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('',,$co...

相关文章

    暂无相关文章

PHP之友评论

今天推荐