劫持 function_core.php,function_core.php文件中常用函数

雨哲在开发插件的时候喜欢直接调用系统本身有的函数来实现,不太喜欢重复定义相同功能的函数,这里收集一下常用的function_core.php文件中的函数。

1、验证邮箱地址有效性:isemail($email);

2、随机字符:random($length, $numeric = 0);

3、查找字符是否存在:strexists($string, $find);

4、调用用户头像:avatar($uid, $size = 'middle', $returnsrc = FALSE, $real = FALSE, $static = FALSE, $ucenterurl = '');

5、调用语言包:lang($file, $langvar = null, $vars = array(), $default = null);

6、调用报错页面:system_error($message, $show = true, $save = true, $halt = true);

7、根据用户ID获取用户信息:getuserbyuid($uid, $fetch_archive = 0);

8、获取当前用户扩展字段:getuserprofile($field);

9、在预定义字符之前添加反斜杠的字符串(支持数组):daddslashes($string, $force = 1);【相关:unc_string_addslashes.asp】

10、加密解密:authcode($string, $operation = 'DECODE', $key = '', $expiry = 0);

11、获取文件:dfsockopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE, $encodetype  = 'URLENCODE', $allowcurl = TRUE, $position = 0, $files = array());

12、把预定义的字符转换为 HTML 实体(支持数组):dhtmlspecialchars($string, $flags = null);【相关:func_string_htmlspecialchars.asp】

13、函数输出一条消息,并退出当前脚本:dexit($message = '');

14、查找字符并返回(支持在数组中查找):dstrpos($string, $arr, $returnvalue = false);

15、引用模板:template($file, $templateid = 0, $tpldir = '', $gettplfile = 0, $primaltpl='');

16、签名:dsign($str, $length = 16)、modauthkey($id);

17、载入缓存数据:loadcache($cachenames, $force = false);

18、UNIX 时间戳格式化日期:dgmdate($timestamp, $format = 'dt', $timeoffset = '9999', $uformat = '');

19、日期转 UNIX 时间戳:dmktime($date);

20、计算字符长度:dstrlen($str);

21、截取长度:cutstr($string, $length, $dot = ' ...');

22、删除反斜杠(支持数组):dstripslashes($string);

23、根据aid获取缩略图:getforumimg($aid, $nocache = 0, $w = 140, $h = 140, $type = '');

24、错误提示:showmessage($message, $url_forward = '', $values = array(), $extraparam = array(), $custom = 0);

25、提交表单验证:submitcheck($var, $allowget = 0, $seccodecheck = 0, $secqaacheck = 0);

26、分页:multi($num, $perpage, $curpage, $mpurl, $maxpages = 0, $page = 10, $autogoto = FALSE, $simple = FALSE, $jsfunc = FALSE);

27、简单分页:simplepage($num, $perpage, $curpage, $mpurl);

28、生成目录:dmkdir($dir, $mode = 0777, $makeindex = TRUE);

29、来路地址:dreferer($default = '');

30、编码转换:diconv($str, $in_charset, $out_charset = CHARSET, $ForceTable = FALSE);

31、格式化字节大小:sizecount($size);

32、发送提醒:notification_add($touid, $type, $note, $notevars = array(), $system = 0);

33、发送站内短信:sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0);

34、统计指定表指定条件的结果数量:getcount($tablename, $condition);

35、intval字符(支持数组):dintval($int, $allowarray = false);

36、删除反斜杠并反序列化:dunserialize($data);

37、获取编码类型:currentlang();

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值