劫持 function_core.php,function_core.php文件中常用函数
雨哲在開發(fā)插件的時候喜歡直接調(diào)用系統(tǒng)本身有的函數(shù)來實現(xiàn),不太喜歡重復(fù)定義相同功能的函數(shù),這里收集一下常用的function_core.php文件中的函數(shù)。
1、驗證郵箱地址有效性:isemail($email);
2、隨機字符:random($length, $numeric = 0);
3、查找字符是否存在:strexists($string, $find);
4、調(diào)用用戶頭像:avatar($uid, $size = 'middle', $returnsrc = FALSE, $real = FALSE, $static = FALSE, $ucenterurl = '');
5、調(diào)用語言包:lang($file, $langvar = null, $vars = array(), $default = null);
6、調(diào)用報錯頁面:system_error($message, $show = true, $save = true, $halt = true);
7、根據(jù)用戶ID獲取用戶信息:getuserbyuid($uid, $fetch_archive = 0);
8、獲取當(dāng)前用戶擴展字段:getuserprofile($field);
9、在預(yù)定義字符之前添加反斜杠的字符串(支持?jǐn)?shù)組):daddslashes($string, $force = 1);【相關(guān):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、把預(yù)定義的字符轉(zhuǎn)換為 HTML 實體(支持?jǐn)?shù)組):dhtmlspecialchars($string, $flags = null);【相關(guān):func_string_htmlspecialchars.asp】
13、函數(shù)輸出一條消息,并退出當(dāng)前腳本:dexit($message = '');
14、查找字符并返回(支持在數(shù)組中查找):dstrpos($string, $arr, $returnvalue = false);
15、引用模板:template($file, $templateid = 0, $tpldir = '', $gettplfile = 0, $primaltpl='');
16、簽名:dsign($str, $length = 16)、modauthkey($id);
17、載入緩存數(shù)據(jù):loadcache($cachenames, $force = false);
18、UNIX 時間戳格式化日期:dgmdate($timestamp, $format = 'dt', $timeoffset = '9999', $uformat = '');
19、日期轉(zhuǎn)?UNIX 時間戳:dmktime($date);
20、計算字符長度:dstrlen($str);
21、截取長度:cutstr($string, $length, $dot = ' ...');
22、刪除反斜杠(支持?jǐn)?shù)組):dstripslashes($string);
23、根據(jù)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、編碼轉(zhuǎn)換:diconv($str, $in_charset, $out_charset = CHARSET, $ForceTable = FALSE);
31、格式化字節(jié)大小:sizecount($size);
32、發(fā)送提醒:notification_add($touid, $type, $note, $notevars = array(), $system = 0);
33、發(fā)送站內(nèi)短信:sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0);
34、統(tǒng)計指定表指定條件的結(jié)果數(shù)量:getcount($tablename, $condition);
35、intval字符(支持?jǐn)?shù)組):dintval($int, $allowarray = false);
36、刪除反斜杠并反序列化:dunserialize($data);
37、獲取編碼類型:currentlang();
總結(jié)
以上是生活随笔為你收集整理的劫持 function_core.php,function_core.php文件中常用函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php 移动端隐藏引导页,移动端引导设计
- 下一篇: php水平线代码,在HTML中水平线标注