PHP技术面试题

会基于面试者的简历,问如下的一些问题: OOP 面向对象的3个特性:封装、继承、多态 什么是多态? PHP下如何实现多态? 什么是接口? 什么是抽象类? 接口和抽象类的区别 ? 框架 阅读源码是提升编程能力的最佳手段。不读阅读源码的开发者,是不合格的。 ...

2020年7月29日 · 5 分钟 · zgia

php 5.4 + apache 2 + xdebug 2 + Windows

如果配置xdebug有问题,请先配置好php,然后把phpinfo()输出到浏览器的html复制到页面: http://xdebug.org/wizard.php 中的输入框,然后点击按钮:“Analyse my phpinfo() output”,让xdebug帮你决定用哪个php_xdebug.dll。

2013年2月27日 · 1 分钟 · zgia

python学习笔记

1、PyYAML,python实现的YAML,号称另一种标记语言(YAML Ain’t Markup Language)。YAML目前是1.2版本。 http://pyyaml.org/wiki/PyYAMLDocumentation http://yaml.org/ 2、Salt,Salt 是一个强大的远程执行管理器,用于快速和高效的服务器管理。 ...

2012年3月27日 · 1 分钟 · zgia

[更新到 v0.3]Show baby’s age / 一个显示某人多大的wordpress插件

原文:《Show baby’s age / 一个显示某人多大的wordpress插件》,v0.3下载地址:babyage.0.3 还是08年的上传到wp,一直未改动,都忘记有这么一个玩意了。昨晚有个用户发邮件问我还在维护吗?新版本的wp不能使用了。 ...

2012年3月7日 · 1 分钟 · zgia

使用ZipArchive压缩目录

想备份整个网站,就想到先把整个网站打包,然后下载。 下面的代码中,最重要的是:**$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(“app/”));**这句。 ...

2010年9月18日 · 1 分钟 · zgia

Windows下使用PHP+LDAPS

1、启用:php_openssl.dll; 2、新建目录:c:\openldap\sysconf(c是系统盘); 3、在sysconf下新建文件:ldap.conf,文件内容:TLS_REQCERT never。 4、重启apache(IIS我没有试过,估计也是这样做) 测试: ...

2010年4月16日 · 1 分钟 · zgia

使用php的unpack判断文件类型

从这里看到的: http://www.adayinthelifeof.nl/2010/01/14/handling-binary-data-in-php-with-pack-and-unpack/ http://www.garykessler.net/library/file_sigs.html 文中给了PNG示例。我仿了一下,给了JPG示例。 $fh = fopen('e:/temp/d3.jpg', 'rb'); $jpg = fread ($fh, 14); $header = unpack ("C4header/C2length/A4identifier/C1?/C2version/C1units/", $jpg); fclose($fh); print_r($header); 格式如下 Start of Image (SOI) marker – two bytes (FFD8) JFIF marker (FFE0) length – two bytes identifier – five bytes: 4A, 46, 49, 46, 00 (the ASCII code equivalent of a zero terminated “JFIF” string) ...

2010年2月6日 · 1 分钟 · zgia

Windows Live Writer 向 DEDECMS 发文章

这个需求很另类啊,不过已经基本实现了(基于wordpress自带的xmlrpc.php而成)。可用的功能有: 使用dedecms自己的模板、CSS; 发表带图片的文章; 列出最近发表的文章; 指定分类(取消了live writer新建分类的功能); 标签; 文章来源; 文章作者; 文章简介; 设置发表时间 待实现功能:编辑已经发表的文章。 //**** 相关文章: Windows Live Writer Provider Customization API WordPress themes on Live Writer Weblog Client ...

2009年4月30日 · 1 分钟 · zgia

通过phpmailer备份文件到gmail

* 将文件作为Gmail附件备份到Gmail中 * ver 1.0 * 2008-11-15 zGia! * wuliuqiba@gmail.com PHPMailer: http://phpmailer.codeworxtech.com/ http://sourceforge.net/projects/phpmailer PHP email transport class featuring file attachments, SMTP servers, CCs, BCCs, HTML messages, word wrap, and more. Sends email via sendmail, PHP mail(), QMail, or with SMTP. php /** * 将文件作为Gmail附件备份到Gmail中 * ver 1.0 * 2008-11-15 zGia! * wuliuqiba@gmail.com */ error_reporting(E_ALL); //error_reporting(E_STRICT); date_default_timezone_set('Asia/Shanghai'); //@header('Content-Type: text/html; charset=utf-8'); include("class.phpmailer.php"); // ############################################################################## // Gmail标签 // 通过filter,设置邮件自动分拣。比如设置filter: // Matches: to:(xxxxx+book@gmail.com) // Do this: Skip Inbox, Apply label "book" $labels = array( "nolabel" = "", "book" => "book", "backup" => "backup" ); // 是否将多个附件发送到一个邮件中 $more_attaches_email = false; // 附件 // 不能发送可执行文件或大于 20 MB 的邮件 $attaches = array( "E:\phpmailer.rar", ); // 发邮件 if ($more_attaches_email) { mailer($labels['book'], $attaches); } else { foreach ($attaches as $attach) { mailer($labels['backup'], $attach); } } // ############################################################################## // 传送门 function mailer($label, &$attaches) { unset($mail); $mail =& init_mail($label); send_mail($mail, $attaches); } // ############################################################################## // 发邮件 function send_mail(&$mail, &$attaches) { // 邮件主题,正文 $subject = ""; if(empty($attaches)) { echo "No attach!"; exit; } // 多附件 if(is_array($attaches)) { foreach ($attaches as $attach) { $mail->AddAttachment($attach); $subject .= "|" . basename($attach); } } // 单附件 else { $mail->AddAttachment($attaches); $subject .= "|" . basename($attaches); } $subject = preg_replace("/^\|/i", "", $subject); echo "Sending $subject now......\n\t\t"; $mail->Subject = $subject; $mail->Body = preg_replace("/\|/i", " ", $subject); if(!$mail->Send()) { echo "Failure: " . $mail->ErrorInfo; } else { echo "Success, message sent."; } echo "\n"; } // ############################################################################## // 初始化 PHPMailer function init_mail($label = "") { // 构造 $mail = new PHPMailer(); // 使用 SMTP $mail->IsSMTP(); // 激活 SMTP 验证你哦是 $mail->SMTPAuth = true; // 下面3个配置不明白的,可以查看此链接: // http://mail.google.com/support/bin/answer.py?answer=76147 // 此服务器要求安全连接 $mail->SMTPSecure = "ssl"; // 使用 Gmail 作为 SMTP 服务器 $mail->Host = "smtp.gmail.com"; // Gmail 服务器的 SMTP 端口号 $mail->Port = 465; // ****************** 从这里开始 ************************* // 发送邮件的 Gmail 账户 $mail->Username = "username@gmail.com"; $mail->Password = "password"; // 添加回复到 //$mail->AddReplyTo("replyto@gmail.com","replyto"); // 发信人 $mail->From = "sender@gmail.com"; $mail->FromName = "sender"; // 收信人 $mail->AddAddress("recipients" . ($label ? "+$label" : "") . "@gmail.com", "recipients"); // ****************** 到这里结束,改成你自己的gmail账号 ************************* // 邮件编码 $mail->CharSet = "utf-8"; // HTML 格式邮件,如果使用文本模式查看的话,所显示的信息 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // 正文折行 $mail->WordWrap = 50; // 可以使用某个文件内容作为邮件正文 //$body = $mail->getFile('contents.html'); //$body = eregi_replace("[\]",'',$body); //$mail->MsgHTML($body); // 发送 HTML 格式邮件 $mail->IsHTML(true); return $mail; }

2008年11月16日 · 2 分钟 · zgia

新的开发任务:HXSD Gallery More

其实很简单,分类-图集-图片。 分类有图集A,B,C……每个图集有若干图片; 浏览图集时,只显示一张图片,点击图片浏览图集中的另一张图片;通过链接切换到前一个、后一个图集; 在分类中上传图片(GIF,PNG,JPG),则生成图集;可以上传ZIP文件; 在浏览图集时,上传图片,则将图片上传到当前图集中; 可以使用幻灯片方式浏览分类、图集中的图片,提供了多种特效(浏览器支持才行); 评论、评分、下载图片、显示图片的EXIF信息等等都是基本功能啦。

2008年7月23日 · 1 分钟 · zgia