2014年11月27日

move_uploaded_file 失败问题

摘要: 文件上传成功了,但是无法使用move_uploaded_file函数移动文件,很可能是移动位置所在目录的问题.1.目录不存在,这个就新建对应文件夹就可以了.2.目录的权限问题,如果确实有读写权限那么就要考虑是否是对应用户的. 阅读全文

posted @ 2014-11-27 09:19 chenzhaojx 阅读(1832) 评论(0) 推荐(0) 编辑

2014年11月21日

提示You don't have permission to access /index.php on this server.

摘要: 被坑了,Apache多站点配置,本来配置的很正常的,结果电脑重装以后在配置结果就不行了,查了n久还是不行,但最后还是找到原因了.httpd.conf 中这样的 AllowOverride none Require all granted改成下面这段 Options FollowSy... 阅读全文

posted @ 2014-11-21 10:52 chenzhaojx 阅读(846) 评论(0) 推荐(0) 编辑

2014年10月22日

jQuery获取所有html

摘要: var html = $('#id')[0].outerHTML; 阅读全文

posted @ 2014-10-22 14:47 chenzhaojx 阅读(190) 评论(0) 推荐(0) 编辑

2014年8月27日

php 身份证号检测

摘要: function idcard_verify_number($idcard_base){if (strlen($idcard_base) != 17){return false;}$factor = array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, ... 阅读全文

posted @ 2014-08-27 11:31 chenzhaojx 阅读(429) 评论(0) 推荐(0) 编辑

php获取用户ip

摘要: function getip(){ if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CLIENT_IP'); //可伪造 } elseif (getenv('HTTP_X_FORWARDED_FOR')) { $ip = getenv('HT... 阅读全文

posted @ 2014-08-27 11:26 chenzhaojx 阅读(286) 评论(0) 推荐(0) 编辑

sql 随机查询数据

摘要: SELECT {$field} FROM {$table} as t1 WHERE id IN ( SELECT t.id FROM (SELECT id FROM {$table} where 1=1 {$where} ORDER BY RAND() {$limit} ) AS t ) 阅读全文

posted @ 2014-08-27 11:24 chenzhaojx 阅读(368) 评论(0) 推荐(1) 编辑

php 二维数组排序

摘要: function array_sort($arr,$keys,$type='asc'){ $keysvalue= $new_array= array(); foreach($arr as $k=>$v){ $keysvalue[$k] = $v[$keys]; } if($type== ... 阅读全文

posted @ 2014-08-27 11:18 chenzhaojx 阅读(108) 评论(0) 推荐(0) 编辑

php 处理 json_encode 中文显示问题

摘要: /** * 对数组和标量进行 urlencode 处理 * 通常调用 wphp_json_encode() * 处理 json_encode 中文显示问题 * @param array $data * @return string */function wphp_urlencode($data) ... 阅读全文

posted @ 2014-08-27 11:15 chenzhaojx 阅读(365) 评论(0) 推荐(0) 编辑

php输出cvs文件,下载cvs文件

摘要: function outputCsv($data, $filename = 'file.csv') {//输出文件,下载文件 header('Content-Type:application/force-download'); header("content-Disposition:filename... 阅读全文

posted @ 2014-08-27 11:14 chenzhaojx 阅读(399) 评论(0) 推荐(0) 编辑

php服务器端生成csv文件

摘要: /** * 将数组动态输出至 csv 文件【服务器端生成文件】 * @param array $data 二维数组 * @param string $filename 文件名 */function writeCsv($data, $filename = 'file.csv') { $fp = fop... 阅读全文

posted @ 2014-08-27 11:12 chenzhaojx 阅读(505) 评论(0) 推荐(0) 编辑

导航