- 博客(21)
- 收藏
- 关注
原创 PHP 通过迭代创建级联目录
<?php //迭代学习 //通过迭代创建目录 function createDir($path){ $arr = array(); while(!is_dir($path)){ array_push($arr,$path); $path = dirname($path);//工作计划入栈 } if(empty($
2015-02-24 14:58:41
312
原创 PHP 递归学习
<?php//求1+2+3+。。。。+n的和 function sum($n){ if($n == 1){ return 1; }else{ return $n + sum($n-1); } }echo sum(5);echo '';//打印目录 function getDirs($path,$count){
2015-02-24 14:10:13
337
转载 JS 网页中通过js控制图片的左右上下移动
<!-- function Fleft() { var x1=document.getElementById("img1").style.left; var x=eval(Number(x1.substring(0,x1.length-2))-20); document.getElementById("img1").style.left=x+"px"; } function F
2015-01-05 09:43:48
1351
转载 IOS 设置NSZombieEnabled和MallocStackLogging
在XCode,4以上版本中,设置NSZombieEnabled和MallocStackLogging1.点击XCode的Product菜单,选择Edit Scheme...选项2.选择左侧的Run...,右边点击Arguments3.在Environment Variables栏里,添加NSZombieEnabled,value为YES;再添加MallocStackLogg
2014-12-30 09:59:03
953
转载 IOS xcode5时代如何设置Architectures和Valid Architectures
xcode5时代如何设置Architectures和Valid Architectures目前ios的指令集有以下几种:1,armv6,支持的机器iPhone,iPhone2,iPhone3G及对应的iTouch2,armv7,支持的机器iPhone4,iPhone4S3,armv7s,支持的机器iPhone5,iPhone5C4,arm64,支持的机器:iPh
2014-12-30 09:50:14
358
转载 IOS XCode6.0中,如何使用XCode生成.ipa文件,以确定包尺寸?
1. 生成存档文件。在XCode 6.0中,菜单 Product->Archive。 2. 打开Ognizer窗口。菜单Window->Oganizer 3. 找到.xcarchive文件。在Oganizer选中存到文件,右键弹出菜单,选择Show in Finder. 4. 找到.app文件。右键点击.xcarchive文件,在弹出菜单中选中“显示包内容",在Produc
2014-12-24 16:49:53
373
原创 IOS:学习添加一个简单的UINavigationBar
UINavigationBar *navigationBar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, 20)]; //导航栏左边按钮 UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWi
2014-12-11 17:35:20
282
转载 IOS关于UIView 的autoresizingMask属性
在UIView中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高。enum{ UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 UIViewAutoresizingFlexi
2014-12-11 16:56:22
319
转载 Apache中限制和允许特定IP访问
Apache中限制和允许特定IP访问在D:\wamp\bin\apache\Apache2.4.4\conf 下的httpd.conf中# Require all granted# onlineoffline tag - don't remove Order Deny,Allow Deny from all Allow from 127
2014-12-05 17:46:35
926
原创 PHP学习:日志记录功能
<?phpclass Log{ const LOGFILE = 'curr.log'; public static function write($str){ $str .= "\r\n"; //判断是否备份 $log = self::isBak(); $fh = fopen($log,'ab'); fwrite($fh,$str); fclose($fh)
2014-12-02 11:21:40
384
原创 PHP目录的简单操作学习
<?php //匹配文件print_r(glob('./mulu/*.txt'));/**opendir 打开目录readdir 读取目录mkdir 创建目录rmdir 删除目录closedir 关闭目录句柄is_dir 判断是否为目录*/$path = './misc';$dh = opendir($path);while(($filename = readd
2014-12-01 18:08:16
252
原创 PHP把四个小文件中,小于10字节或者包含fuck的文件都删掉
<?php /**把四个小文件中,小于10字节或者包含fuck的文件都删掉。*/$arr = array('a.txt','b.txt','c.txt','d.txt');foreach($arr as $v){ $file = './mulu/'.$v; if(filesize($file) < 10){ unlink($file); echo $file,'
2014-12-01 14:00:33
401
原创 PHP读取csv文件
一,先创建excel文件,并写入数据二、选择excel文件另存为csv格式,三、写PHP程序读取csv文件:<?php $file = './fenshu.csv';$content = fopen($file,'rb');while(!feof($content)){ print_r(fgetcsv($content));}
2014-12-01 11:36:49
395
原创 PHP用文件操作函数,批量处理客户名单
<?php/**用文件操作函数,批量处理客户名单*//*第一种各操作系统下,换行符不一致windows \r\n*nix \nmac \r*/$file = './custom.txt';$source = file_get_contents($file);print_r(explode('\r',$source));/*第二种一次读一行rb中的b
2014-12-01 09:56:06
649
转载 php连mysql报错:Call to undefined function mysql_connect()
1. 配置php.ini:把php.ini中原有的注释;extension=php_mysql.dll改为extension=php_mysql.dll;然后extension_dir = "./"改为extension_dir = "D:/php/ext"。2. apache的配置:#Installi
2014-11-26 11:38:01
413
原创 PHP学习:单例
<?php header('Content-type :text/html ; charset = utf-8');class Person{ private $hash; static private $p; private function __construct(){ $this->hash = mt_rand(1,99999); } static public
2014-11-21 17:51:56
246
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人