12 2015 档案

摘要:创建一个文件夹:public function index(){ if (!is_dir('d:/hl')) { mkdir('d:/hl'); }else{ echo '文件夹已经存在'; } }创建层级文... 阅读全文
posted @ 2015-12-27 01:11 屌丝IT男 阅读(253) 评论(0) 推荐(0)
摘要:代码:public function index(){ $path='G:/相片/2014.9.8深圳莲花山/IMG_1282.JPG'; $path=iconv('utf-8','gb2312',$path);//转码,使汉子路径能解析 copy($pat... 阅读全文
posted @ 2015-12-27 00:44 屌丝IT男 阅读(647) 评论(0) 推荐(0)
摘要:第一种方法:public function index(){ $path='./Public/test.txt'; $fp=fopen($path,'a+'); fwrite($fp,"\r\n你好"); fclose($fp); }第二... 阅读全文
posted @ 2015-12-27 00:32 屌丝IT男 阅读(358) 评论(0) 推荐(0)
摘要:第一种方法:public function index(){ if($file=fopen('./Public/test.txt','a+')){ $file_info=fread($file,filesize('./Public/test.txt')); ... 阅读全文
posted @ 2015-12-26 22:46 屌丝IT男 阅读(162) 评论(0) 推荐(0)
摘要:文件打开操作可以取到文件大小,创建、修改、访问等信息,代码如下:public function index(){ if($file=fopen('./Public/test.txt','r')){ $file_info=fstat($file); ... 阅读全文
posted @ 2015-12-26 20:36 屌丝IT男 阅读(275) 评论(0) 推荐(0)
摘要:前台代码: Document php代码:public function getAjax(){ $data=array( 'data'=>'这是我要的数据', 'info'=>'信息... 阅读全文
posted @ 2015-12-26 17:42 屌丝IT男 阅读(263) 评论(0) 推荐(0)
摘要:利用原生JSON对象,将对象转为字符串var jsObj = {};jsObj.testArray = [1,2,3,4,5];jsObj.name = 'CSS3';jsObj.date = '8 May, 2011';var str = JSON.stringify(jsObj);alert(s... 阅读全文
posted @ 2015-12-26 16:31 屌丝IT男 阅读(285) 评论(0) 推荐(0)
摘要:简单判断用户名存在不存在,如果数据库存在此用户名,提示不能注册前台代码如下: Document 用户名: php代码:public function checkName(){ $usern... 阅读全文
posted @ 2015-12-26 15:22 屌丝IT男 阅读(192) 评论(0) 推荐(0)
摘要:HP QR Code是一个PHP二维码生成类库,利用它可以轻松生成二维码,官网提供了下载和多个演示demo,查看地址:http://phpqrcode.sourceforge.net/下载官网提供的类库后,只需要使用phpqrcode.php就可以生成二维码了,当然您的PHP环境必须开启支持GD2。... 阅读全文
posted @ 2015-12-16 21:04 屌丝IT男 阅读(231) 评论(0) 推荐(0)
摘要:1、概述“Group By”从字面意义上理解就是根据“By”指定的规则对数据进行分组,所谓的分组就是将一个“数据集”划分成若干个“小区域”,然后针对若干个“小区域”进行数据处理。2、原始表3、简单Group By示例1select 类别, sum(数量) as 数量之和from Agroup by ... 阅读全文
posted @ 2015-12-16 20:57 屌丝IT男 阅读(183) 评论(0) 推荐(0)
摘要:1、httpd.conf中把 改成 2、在httpd.conf末端加上此代码: 3、在C:\Windows\System32\drivers\etc中找到hosts,最下面修改以下代码: 阅读全文
posted @ 2015-12-16 10:59 屌丝IT男 阅读(174) 评论(0) 推荐(0)
摘要:模板程序: php程序:public function upload(){ $upload=new \Think\Upload(); $upload->maxSize=3145728; $upload->exts=arr... 阅读全文
posted @ 2015-12-01 10:48 屌丝IT男 阅读(123) 评论(0) 推荐(0)