劫持 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();
總結
以上是生活随笔為你收集整理的劫持 function_core.php,function_core.php文件中常用函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php 移动端隐藏引导页,移动端引导设计
- 下一篇: php水平线代码,在HTML中水平线标注