04 2013 档案
摘要:echo "单件模式 控件PHP类的实例化次数";class text{ const name="text"; public static $havenew = false; public $name = "我被限制为只能实例化一次!"; protected static $o_self; private function __construct() { } public function __destruct() { self::$havenew = false; } public static function initer()
阅读全文
摘要:require("class.phpmailer.php"); //这个是一个smtp的php文档,网上可以下载得到$mail = new PHPMailer(); //建立邮件发送类$mail->CharSet = "UTF-8";$address ="sdasdsadsa@qq.com";$mail->IsSMTP(); // 使用SMTP方式发送$mail->Host = "smtp.126.com"; // 您的企业邮局域名$mail->SMTPAuth = true; // 启用S
阅读全文
摘要:<?phpheader("Content-Type:text/html; charset=utf-8");$data = array( array('cid'=>26,'parent_cid'=>0,'name'=>"饭"), array('cid'=>27,'parent_cid'=>26,'name'=>"米饭"), array('cid'=>28,'parent_
阅读全文
摘要:/*testXdebug();function testXdebug(){ requireFile();}function requireFile(){ require_once("abc.php");}*///debug对var_dump()函数进行了覆盖,显示更好//$arrTest = array("test"=>"abc","test2"=>"abc2");//var_dump($arrTest);//如何利用Xdebug测试脚本执行时间// xdebug_time_inde
阅读全文
摘要:下载地址:http://sourceforge.net/projects/snoopy/Snoopy是一个php类,用来模拟浏览器的功能,可以获取网页内容,发送表单。Snoopy正确运行需要你的服务器的PHP版本在4以上,并且支持PCRE(Perl Compatible Regular Expressions),基本的LAMP服务都支持。一、Snoopy的一些特点: 1.抓取网页的内容 fetch 2.抓取网页的文本内容 (去除HTML标签) fetchtext 3.抓取网页的链接,表单 fetchlinks fetchform 4.支持代理主机 5.支持基本的用户名/密码验证 6...
阅读全文