上一页 1 2 3 4 5 6 ··· 11 下一页
摘要: /**[ 过滤上传特殊表情符号的 ] * @param $str * @return mixed */ function filter_emoji($str) { $str = preg_replace_callback( //执行一个正则表达式搜索并且使用一个回调进行替换 '/./u', function (array $match) { ... 阅读全文
posted @ 2019-08-05 22:16 好笑。 阅读(2038) 评论(0) 推荐(0) 编辑
摘要: /** * 检测是否使用手机访问 * @access public * @return bool */ public function isMobile() { if (isset($_SERVER['HTTP_VIA']) && stristr($_SERVER['HTTP_VIA'], "wap")) { return true; } elseif (... 阅读全文
posted @ 2019-08-05 22:14 好笑。 阅读(246) 评论(0) 推荐(0) 编辑
摘要: public function arrayLevel($arr){ $al = array(0); function aL($arr,&$al,$level=0){ if(is_array($arr)){ $level++; $al[] = $level; foreach($arr as $v... 阅读全文
posted @ 2019-08-05 22:13 好笑。 阅读(124) 评论(0) 推荐(0) 编辑
摘要: /** * 字母头像 * @param $text * @return string */ function letter_avatar($text) { $total = unpack('L', hash('adler32', $text, true))[1]; $hue = $total % 360; ... 阅读全文
posted @ 2019-04-26 14:22 好笑。 阅读(443) 评论(0) 推荐(0) 编辑
摘要: /** * 以二维数组的某个键对数组进行排序 * Param: 参数说明 * $data array 二维数组 * last_names string 数组中的键 * Return : 返回值 * $data array 排序后的二维数组 */ $last_names = array_column($data,'last_name'); array_multisort($last... 阅读全文
posted @ 2019-04-22 16:29 好笑。 阅读(107) 评论(0) 推荐(0) 编辑
摘要: //获取汉字首拼---注意:汉字不以u,v首拼 function getfirstchar($s0){ $fchar = ord($s0{0}); if($fchar >= ord("A") and $fchar = -20319 and $asc = -20283 and $asc = -19775 and $asc = -19218 and $asc ... 阅读全文
posted @ 2019-04-22 16:20 好笑。 阅读(288) 评论(0) 推荐(0) 编辑
摘要: /** * 中英数字混合的字符串截取 * Param: 参数说明 * 【in】$sourcestr string 截取字符串 * 【in】$cutlength int 截取长度 */ public function assoc_substr($sourcestr, $cutlength) { $returnstr = ... 阅读全文
posted @ 2019-04-22 16:01 好笑。 阅读(326) 评论(0) 推荐(0) 编辑
摘要: action(); if (!in_array($action, $arr)) { // $this->verifyClient(); } } /** * 客户端验证签名 */ private function verifyClient() { //删除用户后不能在进行... 阅读全文
posted @ 2019-04-20 11:30 好笑。 阅读(203) 评论(0) 推荐(0) 编辑
摘要: ceil 进一法取整 返回大于value的下一个整数,若value有小数部分则进一位 eg:echo ceil(9.999) //10 floor 舍去法取整 返回小于value的下一个整数,若value有小数部分则舍去取整 eg:echo floor(9.999) //9 intval 对变数转成 阅读全文
posted @ 2019-04-20 11:11 好笑。 阅读(207) 评论(0) 推荐(0) 编辑
摘要: /** * Description:将秒数转换为00:00:00(时分秒格式) * Param:参数说明 * [in] $times int n秒 * Return:返回值 * 00:00:00(时分秒) */ function time_conversion($times){ $result = '00:00'; if ($times>0){ ... 阅读全文
posted @ 2019-04-20 10:31 好笑。 阅读(963) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 11 下一页