在UT框架中引用use library\UsualToolInc\UTInc
静态方法调用:UTInc::xx
实例化调用:$inc=new UTInc();$inc->xxxx()
方法包含:
- 获取UT全局配置参数
GetConfig() - 跳转链接
GoUrl($url,$text='') - 严格过滤
SqlCheck($str) - 反解析严格过滤
DeSqlCheck($str) - 危险符号转换
SqlChecks($str) - 危险函数过滤
SqlCheckv($str) - 过滤并验证数字
SqlCheckx($str) - 清除字符中的数字
ClearNum($str) - 清除Html脚本
DeleteHtml($str) - 提取字符串中的所有图片
FindImage($str) - 去除URL中的指定参数
ClearParam($param,$url) - 判断某个字符在字符串中是否存在
Contain($split,$string) - 合并两个数组
ArrayMerge(&$a,$b) - 检测模块和页面是否存在
ModSearch($page,$mod) - 删除模块集合中的某个模块
DelModArray($arr,$key) - 获取模块集合
GetMod($type=0) - 获取插件集合
GetPlugin($type=0) - 获取模板工程集合
GetTemplate($type=0) - 引用UT插件
Plugin($pluginname,$pluginroot='index.php') - UT令牌验证
Auth($authcode,$authurl,$apitype) - 生成随机字符串
GetRandomString($length,$chars=null) - 获取IP地址
GetIp() - 判断是否为移动端
IsApp() - 字节单位格式化
ForBytes($size) - 在指定位置截取字符串
CutSubstr($str,$start=0,$length=0,$charset="utf-8",$suffix=true) - 取年月日
OpenDate($thisdate,$type) - 截取字符串中的中文字符
CnSubStr($string,$length='0') - preg方式截取字符串
PregSubstr($start,$end,$str) - explode方式截取字符串
StrSubstr($start,$end,$str) - 按照指定字符截取字符串
SubKey($str,$key,$len=100,$enc='utf-8') - POST方式提交数据
HttpPost($url,$data,$gzip='0') - GET方式提交数据
HttpGet($url,$gzip='0') - 获取指定地址网络状态
HttpCode($url) - 获取当前域名(协议+域名+端口)
GetDomain() - 获取当前页面地址
CurPageUrl() - 获取模板末尾节点路径
TempEndPath() - 保存远程文件
SaveFile($url,$save_dir='',$filename='',$type=0) - 检测文件夹权限
FileMode($path) - 创建文件夹
MakeDir($dir,$mode=0777) - 编辑文件夹名称
EditDir($oldpath,$newpath) - 获取文件列表
GetDir($path) - 删除文件
UnlinkFile($file) - 删除文件夹
DelDir($directory) - 移动文件夹
MoveDir($oldpath,$newpath) - 查询文件夹是否存在
SearchDir($dir) - 查询文件是否存在
SearchFile($file) - 获取服务器信息
GetSystemInfo() - 检测文件编码
DetectEncoding($file) - 图片转为Base64编码
ImgToBase64($img='') - Base64编码转为图片
Base64ToImg($base64,$path) - 向浏览器推送下载文件
Download($file) - each 7.x版本替代方法
NewEach(&$array)