摘要: $path = ROOT_PATH . 'public/uploads/headimg'; $pic = base64_image_content($base64_image,$path); //图片路径 $type = str_replace('.','',strrchr($pic,'.')); //获取图片的类型 $image = str_replace('data:ima... 阅读全文
posted @ 2019-08-05 22:25 好笑。 阅读(3565) 评论(0) 推荐(0) 编辑
摘要: setResolution(150,150); $im->setCompressionQuality(100); if($page1==-1) $im->readImage($pdf); else $im->readImage($pdf."[".$page1."]"); foreach ($im as $Key => $Var) ... 阅读全文
posted @ 2019-08-05 22:23 好笑。 阅读(231) 评论(0) 推荐(0) 编辑
摘要: /************************************************************** * Function name: http_request * Description: https请求(支持GET和POST) * Param: 参数说明 * 【in】$url string 请求url * 【in】$data array 请求发送数据 *... 阅读全文
posted @ 2019-08-05 22:22 好笑。 阅读(1204) 评论(0) 推荐(0) 编辑
摘要: 存带微信表情的昵称 原因:utf-8编码可能2个字节、3个字节、4个字节的字符,但是MySQL的utf8编码只支持3字节的数据,而移动端的表情数据是4个字节的字符。如果直接往采用utf-8编码的数据库中插入表情数据,程序中将报SQL异常。 前提:mysql支持utf8mb4的版本不低于5.5.3,m 阅读全文
posted @ 2019-08-05 22:21 好笑。 阅读(865) 评论(0) 推荐(0) 编辑
摘要: //判断是安卓还是ios function phontType(){ //全部变成小写字母 $agent = strtolower($_SERVER['HTTP_USER_AGENT']); $type = 'other'; //分别进行判断 if(strpos($agent, 'iphone') || strpos($agent, 'ipad')) ... 阅读全文
posted @ 2019-08-05 22:18 好笑。 阅读(436) 评论(0) 推荐(0) 编辑
摘要: /**[ 过滤上传特殊表情符号的 ] * @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) 编辑