摘要: 准备:首先查看php的版本,根据php的版本下载memcahced windows版本(下载地址:http://code.jellycan.com/memcached/)下载php_memcache.dll(下载地址:http://downloads.php.net/pierre/)步骤1:安装memcached一.解压文件二.开始->运行->输入cmd打开dos窗口->跳转到memcached的解压目录(如:C:\Program Files\memcache)三.安装memcached 命令:memcached.exe -d install四.启动memchached 命令 阅读全文
posted @ 2013-03-02 16:26 我叫龙弟弟 阅读(926) 评论(0) 推荐(0)
摘要: 函数:strip_tags()作用:去除html标签用处:截取一段文章内容时,如果文章中含有html标签(一般都有,否则无法排版),可能会出现未知错误,从而引起页面错乱,这时就需要使用strip_tags函数去除html标签之后再截取内容范例:<?php$str = "<html><head><title>标题</title></head><body>内容11<br/>内容2</body></html>";$rst = strip_tags($str);head 阅读全文
posted @ 2013-03-02 15:22 我叫龙弟弟 阅读(445) 评论(0) 推荐(0)
摘要: php逐行读取txt文件内容ReadTxt.php文件<?php$handle = @fopen("./cont.txt", "r");$arr = array();if ($handle) { while (!feof($handle)) { $item = fgets($handle, 4096); $arr[] = $item; } fclose($handle); header("Content-type:text/html;charset=utf-8"); echo"<pre>"; pr 阅读全文
posted @ 2013-02-28 20:52 我叫龙弟弟 阅读(4910) 评论(0) 推荐(0)
摘要: 获取客户端IP:print_r($_SERVER['REMOTE_ADDR']);如果记不住IP的键名,可以打印出$_SERVER后查找获取指定网站IP(服务器端IP):$ip = gethostbyname('www.baidu.com');echo $ip; 阅读全文
posted @ 2013-02-27 19:21 我叫龙弟弟 阅读(148) 评论(0) 推荐(0)