2011年12月6日

摘要: function dirSize($directory){ $dir_size=0; if($dir_handle=@opendir($directory)) { while($filename=readdir($dir_handle)) { if($filename!="." && $filename!="..") { $subFile=$directory."/".$filename; if(is_dir($subFile)) { $dir_size+=dirSize($subFile); }... 阅读全文
posted @ 2011-12-06 15:55 天空尚兰 阅读(169) 评论(0) 推荐(0)
摘要: /自己写的一个PDO类class CPdo{protected $_dsn = "mysql:host=localhost;dbname=test";protected $_name = "root";protected $_pass = "";protected $_condition = array();protected $pdo;protected $fetchAll;protected $query;protected $result;protected $num;protected $mode;protected $pre 阅读全文
posted @ 2011-12-06 15:26 天空尚兰 阅读(276) 评论(0) 推荐(0)
摘要: PDO(PHP Data Object) 是PHP 5新出来的东西,在PHP 6都要出来的时候,PHP 6只默认使用PDO来处理数据库,将把所有的数据库扩展移到了PECL,那么默认就是没有了我们喜爱的php_mysql.dll之类的了,那怎么办捏,我们只有与时俱进了,我就小试了一把PDO。(本文只是入门级的,高手可以略过,呵呵)【PDO是啥】PDO是PHP 5新加入的一个重大功能,因为在PHP 5以前的php4/php3都是一堆的数据库扩展来跟各个数据库的连接和处理,什么php_mysql.dll、php_pgsql.dll、php_mssql.dll、php_sqlite.dll等等扩展来连 阅读全文
posted @ 2011-12-06 15:10 天空尚兰 阅读(480) 评论(0) 推荐(0)
摘要: <?php$str="this is a test \n";$patten = array("\r\n", "\n", "\r"); //先替换掉\r\n,然后是否存在\n,最后替换\r $str=str_replace($order, "", $str);?> //php 有三种方法来解决 //1、使用str_replace 来替换换行 $str = str_replace(array("\r\n", "\r", "\n" 阅读全文
posted @ 2011-12-06 14:56 天空尚兰 阅读(2524) 评论(0) 推荐(0)

导航