首页
留言
笔记
归档
友人链
关于
流苏小筑
行动起来,活在当下
累计撰写
139
篇文章
累计创建
57
个标签
累计收到
9
条评论
栏目
首页
留言
笔记
归档
友人链
关于
目 录
CONTENT
自定义函数-流苏小筑
以下是
自定义函数
相关的文章
2019-05-13
PHP自定义函数(16)--- 遍历文件夹下所有文件
function read_all ($dir){ if(!is_dir($dir)) return false; $handle = opendir($dir); if($handle){ while(($fl = readdir($handle)) !== fa
2019-05-13
1
0
0
PHP
2019-05-13
PHP自定义函数(15)--- PHP强制下载文件
function download($filename){ if ((isset($filename))&&(file_exists($filename))){ header("Content-length: ".filesize($filename));
2019-05-13
2
0
0
PHP
2019-05-13
PHP自定义函数(14)--- 获取文件扩展名(后缀)
function getExtension($filename){ $myext = substr($filename, strrpos($filename, '.')); return str_replace('.','',$myext); }
2019-05-13
2
0
0
PHP
2019-05-13
PHP自定义函数(13)--- PHP加密解密
PHP加密解密 function encryptDecrypt($key, $string, $decrypt){ if($decrypt){ $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key)
2019-05-13
1
0
0
PHP
2019-05-13
PHP自定义函数(12)--- 获得一个月的天数
$timestamp = strtotime('October'); //也可以这么写$timestamp = strtotime('2012-02'); $days = date('t',$timestamp); echo $days; //31
2019-05-13
2
0
0
PHP
2019-05-13
PHP自定义函数(11)--- php 将数组保存成文件存在本地
// 文件测试 $array = array( '001' => '123', '002' => '321', '003' => '4321', ); $path = './Cache
2019-05-13
3
0
0
PHP
2019-05-13
PHP自定义函数(10)--- 防sql注入
//sql注入 function inject_check($sql_str) { return eregi('select|insert|and|or|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile',
2019-05-13
3
0
0
PHP
2019-05-13
PHP自定义函数(9)--- 检查用户名的合法性
function CheckUserID($uid, $msgtitle='用户名'){ //系统字符限制 $cfg_mb_notallow = 'www,bbs,ftp,mail,user,users,admin,administrator'; $nas = explode
2019-05-13
2
0
0
PHP
2019-05-13
PHP自定义函数(7)--- 特殊字符过滤
function format_str1($str){ $str = str_replace("\r\n","",$str); $str = str_replace("\n","",$str); $str = str_replace("\r","",$str); $s
2019-05-13
2
0
0
PHP
1
2