Mlsll

  • 首页
  • 豆瓣
  • 站点导航
  • 笔记
  • 友人链
  • 关于
large picture of the cover

thumbnail of the cover of the post

PHP自定义函数(16)--- 遍历文件夹下所有文件

function read_all ($dir){ if(!is_dir($dir)) return false; $handle = opendir($dir); if($handle){ while(($fl = readdir($handle)) !== fa


thumbnail of the cover of the post

PHP自定义函数(15)--- PHP强制下载文件

function download($filename){ if ((isset($filename))&&(file_exists($filename))){ header("Content-length: ".filesize($filename));


thumbnail of the cover of the post

PHP自定义函数(14)--- 获取文件扩展名(后缀)

function getExtension($filename){ $myext = substr($filename, strrpos($filename, '.')); return str_replace('.','',$myext); }


thumbnail of the cover of the post

PHP自定义函数(13)--- PHP加密解密

PHP加密解密 function encryptDecrypt($key, $string, $decrypt){ if($decrypt){ $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key)


thumbnail of the cover of the post

PHP自定义函数(12)--- 获得一个月的天数

$timestamp = strtotime('October'); //也可以这么写$timestamp = strtotime('2012-02'); $days = date('t',$timestamp); echo $days; //31


thumbnail of the cover of the post

PHP自定义函数(11)--- php 将数组保存成文件存在本地

// 文件测试 $array = array( '001' => '123', '002' => '321', '003' => '4321', ); $path = './Cache


thumbnail of the cover of the post

PHP自定义函数(10)--- 防sql注入

//sql注入 function inject_check($sql_str) { return eregi('select|insert|and|or|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile',


thumbnail of the cover of the post

PHP自定义函数(9)--- 检查用户名的合法性

function CheckUserID($uid, $msgtitle='用户名'){ //系统字符限制 $cfg_mb_notallow = 'www,bbs,ftp,mail,user,users,admin,administrator'; $nas = explode


thumbnail of the cover of the post

PHP自定义函数(7)--- 特殊字符过滤

function format_str1($str){ $str = str_replace("\r\n","",$str); $str = str_replace("\n","",$str); $str = str_replace("\r","",$str); $s


thumbnail of the cover of the post

PHP自定义函数(8)--- 获取用户真实 IP

function getIP(){ static $realip; if (isset($_SERVER)){ if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])){ $realip = $_SERVER["


site logo

Hi,Friend

  • 首页
  • 豆瓣
  • 站点导航
  • 笔记
  • 友人链
  • 关于

© 2026 Mlsll

Powered by Halo • Crafted with by LIlGG

© 2026 Mlsll