随笔分类 -  PHP

摘要:After i installed netbeans7.0, the language of is Chinese, thought i am a chinese, but of netbeans, i am not similar with the interface of Chinese, so i have to change the language to english.open the /path_to_netbeans/etc/netbeans.conf, add the code as below:netbeans_default_options="-J-client 阅读全文
posted @ 2011-09-28 21:50 DavidHHuan 阅读(275) 评论(0) 推荐(0)
摘要:在创建网站的时候,很多时候都需要输入一些中文的段落来填充页面,大多数会是找一些新闻之类的来复制粘贴。以下代码是利用php来随机生成一些中文段落,以便用来测试。GBK版:<?phpheader('Content-type:text/html;charset=gbk');functioncreateWords($words=128){$seperate=array(",","。","!","?",";");$strings='';for($i=0;$i<$ 阅读全文
posted @ 2011-09-23 00:07 DavidHHuan 阅读(1789) 评论(1) 推荐(0)
摘要:首先是,我已经在页面已经设置了<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>我本地运行的时候,不需要在浏览器里面设置字符集,也是可以正常看到字符内容的。但我用ftp上传到服务器之后,就出现了乱码,只有手动去设置浏览器显示的字符集为utf-8才能正常显示。通过这样修改就可以解决了。在页面的头部:<?phpheader('Content-type:text/html;charset=utf-8');?>我也怀疑是不是FTP没有强制上传的 阅读全文
posted @ 2011-05-21 11:03 DavidHHuan 阅读(1378) 评论(0) 推荐(0)
摘要:i found a very useful article about the database sharding, here is the content.This article accompanies theslidesfrom a presentation on database sharding. Sharding is a technique used for horizontal scaling of databases we are using at Netlog. If you're interested in high performance, scalability, M 阅读全文
posted @ 2011-01-16 00:54 DavidHHuan 阅读(702) 评论(0) 推荐(0)
摘要:其实,文章的重点是放在了如何配置php的xdebug环境,毕竟环境搭好了,像NetBeans,Eclipse这样的IDE,随便哪个都可以做php的调试的。操作环境:OS: Ubuntu 10.04Server: xampp 1.7.3a1. 下载xdebug.so方便懒人,不用去编译,所以就提供一个32位的xdebug.so。http://download.csdn.net/source/2757... 阅读全文
posted @ 2010-10-15 11:21 DavidHHuan 阅读(714) 评论(0) 推荐(0)
摘要:The code as below :代码 阅读全文
posted @ 2010-06-24 09:12 DavidHHuan 阅读(297) 评论(0) 推荐(0)
摘要:[代码]When running the code, we will get to error:[代码]So, there is no way to define a private in the interface.How about private method in abstract class?[代码]It doesn't course a anything of error or war... 阅读全文
posted @ 2010-06-02 16:43 DavidHHuan 阅读(681) 评论(0) 推荐(0)
摘要:代码 阅读全文
posted @ 2010-06-02 15:54 DavidHHuan 阅读(232) 评论(0) 推荐(0)
摘要:Assume that we have such function:[代码]When we use it as below:代码If we remove the "&" from the function, [代码]The same test code:代码So we got the note that, when using reference in function, we have ... 阅读全文
posted @ 2010-05-15 12:28 DavidHHuan 阅读(310) 评论(0) 推荐(0)
摘要:Which function can be used to format a local timestamp according to a specific locale?The answer is :[代码] 阅读全文
posted @ 2010-05-14 16:43 DavidHHuan 阅读(281) 评论(0) 推荐(1)
摘要:Let say the type of column of "created" is datetime, [代码] 阅读全文
posted @ 2010-05-14 15:47 DavidHHuan 阅读(686) 评论(0) 推荐(1)
摘要:Assuming that image.jpg exists and is readable by PHP, how will the following script bedisplayed if called directly from a browser?[代码]There are four answers: A. As a JPEG imageB. As a binary file for... 阅读全文
posted @ 2010-05-14 15:30 DavidHHuan 阅读(321) 评论(0) 推荐(1)
摘要:What will the following script output?[代码]"Testing 345"?No, we can get the reason from the book of Zend PHP Certification Test Book".This question tests your knowledge of string manipulation and opera... 阅读全文
posted @ 2010-05-14 11:15 DavidHHuan 阅读(301) 评论(0) 推荐(0)
摘要:代码The result: red 阅读全文
posted @ 2010-05-12 16:57 DavidHHuan 阅读(205) 评论(0) 推荐(0)
摘要:ckeditor本身是没有上传文件功能的,它里面所谓的上传设置是没有用的(应该就是这样啦) 这是原文的地址,自己整理了一下,翻译成中文 http://blog.beamstyle.com.hk/tutorial-on-integrating-ckfinderckeditor-into-cakephp 阅读全文
posted @ 2010-04-21 11:07 DavidHHuan 阅读(1374) 评论(0) 推荐(0)
摘要:两个页面都包含以下信息,<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>... 阅读全文
posted @ 2010-04-21 11:04 DavidHHuan 阅读(1030) 评论(0) 推荐(0)
摘要:代码 阅读全文
posted @ 2010-04-21 11:04 DavidHHuan 阅读(675) 评论(0) 推荐(0)
摘要:代码 阅读全文
posted @ 2010-04-21 11:03 DavidHHuan 阅读(1301) 评论(0) 推荐(0)
摘要:PHP还有一个相当令人兴奋的特性:可变变量所谓可变变量,就是一个变量的变量名可以动态的设置和使用。看看下面的例子:1<?php2$a="hello";3$hello="world";4echo$a."".$$a;5?>输出的结果居然是hello,world.太神奇了。$$a其实就是$hello,因为$a的值是hello。变量就这多了。下面看看常量。 阅读全文
posted @ 2010-04-21 11:02 DavidHHuan 阅读(1376) 评论(0) 推荐(0)
摘要:1.打开c:/windows,里面有一个php.ini文件(AppServ居然将php的配置文件移到这里来!),然后在里面搜索 ;extension=php_openssl.dll ,把前面的逗号去掉。2.进入AppServ的安装目录,到php文件夹里面,分别搜索 libeay32.dll 和 ssleay32.dll ,把它们复制到 c:/windows/system32 下面3.重新启动 Ap... 阅读全文
posted @ 2010-04-21 11:02 DavidHHuan 阅读(908) 评论(0) 推荐(0)