<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHPMan--Live and learn &#187; 编程相关</title>
	<atom:link href="http://www.phpman.com.cn/archives/category/coding/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpman.com.cn</link>
	<description>不积跬步,无以至千里;不积小流,无以成江海</description>
	<lastBuildDate>Wed, 28 Jul 2010 02:39:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>和web开发相关的几个rfc文档</title>
		<link>http://www.phpman.com.cn/archives/359</link>
		<comments>http://www.phpman.com.cn/archives/359#comments</comments>
		<pubDate>Wed, 28 Jul 2010 02:33:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[编程相关]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=359</guid>
		<description><![CDATA[RFC1867 Form-based File Upload in HTML
RFC1942 HTML Tables
RFC2616 Hypertext Transfer Protocol
RFC2617 HTTP Authentication: Basic and Digest Access Authentication
RFC4229 HTTP Header Field Registrations
]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/359/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux下批量正则查找替换文本文件内容</title>
		<link>http://www.phpman.com.cn/archives/337</link>
		<comments>http://www.phpman.com.cn/archives/337#comments</comments>
		<pubDate>Tue, 02 Mar 2010 15:35:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[system related]]></category>
		<category><![CDATA[正则语法]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[正则]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=337</guid>
		<description><![CDATA[
find -name '*.html' &#124; xargs perl -pi -e 's&#124;href=&#34;(.*\.html)&#34;&#124;href=&#34;/html/$1&#34;&#124;g'

如上所示为我在所有形如xxx.html前加上/html/
正则查找，非常灵活方便。留帖备忘
]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/337/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>支持ie6 ie7 ie8 firefox的javascript添加至收藏夹代码</title>
		<link>http://www.phpman.com.cn/archives/335</link>
		<comments>http://www.phpman.com.cn/archives/335#comments</comments>
		<pubDate>Tue, 02 Mar 2010 10:31:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[编程相关]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=335</guid>
		<description><![CDATA[
function addfavor&#40;url,title&#41; &#123;
    if&#40;confirm&#40;'确定添加收藏？'&#41;&#41;&#123;
        var ua = navigator.userAgent.toLowerCase&#40;&#41;;
        if&#40;ua.indexOf&#40;&#34;msie 8&#34;&#41;&#62;-1&#41;&#123;
            external.AddToFavoritesBar&#40;url,title,'slice'&#41;;//IE8
        &#125;else&#123;
         [...]]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/335/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php模块动态编译</title>
		<link>http://www.phpman.com.cn/archives/323</link>
		<comments>http://www.phpman.com.cn/archives/323#comments</comments>
		<pubDate>Sat, 09 Jan 2010 11:17:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=323</guid>
		<description><![CDATA[今天编译memcache扩展，由于从别的机器拷过来的，忘记make clean，出了点插曲，备忘下
cd memcache-2.2.5
/usr/local/bin/phpize
make clean
./configure &#8211;enable-memcache &#8211;with-php-config=/usr/local/bin/php-config &#8211;with-zlib-dir
make
make install
编译后会生成memcache.so
例如我的是：
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/
修改php.ini
将extension_dir改为以上目录或将生成的so文件移至extension目录
添加行
extension=memcache.so
]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/323/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>38个精美css 和 jQuery 多级下拉菜单实例</title>
		<link>http://www.phpman.com.cn/archives/319</link>
		<comments>http://www.phpman.com.cn/archives/319#comments</comments>
		<pubDate>Sat, 19 Dec 2009 05:51:42 +0000</pubDate>
		<dc:creator>phpman</dc:creator>
				<category><![CDATA[编程相关]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=319</guid>
		<description><![CDATA[当您需要创建一些内容和菜单部分很多的大型网站时，往往需要<strong>多级的菜单</strong>来将内容分类,这里收集合了<strong>38个 css 和 jQuery 多级下拉菜单解决方案</strong>，主要是基于jQuery和CSS下拉或多层次的下降可加载的文件，并且您只需要修改下CSS。就能快速搭建您自己的多级下拉菜单。]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/319/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>初试手了下bash编程,定期清除日志</title>
		<link>http://www.phpman.com.cn/archives/289</link>
		<comments>http://www.phpman.com.cn/archives/289#comments</comments>
		<pubDate>Wed, 21 Oct 2009 06:38:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[shell]]></category>
		<category><![CDATA[system related]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=289</guid>
		<description><![CDATA[由于公司网站的日志文件按天为目录存放，格式如下
20090901
20090902
……
时间一长，硬盘老暴满，正好前些天看过点shell的知识，应用一下^_^

#!/bin/bash
#日志保留月份数
reserveMonth=2
#需保存的最早一天的日志
oldest=`date -d &#34;-$reserveMonth month&#34; +%Y%m%d`
#日志存放目录
workdir='/home/phpman/test'
#搜索目录
dirs=`ls $workdir -F &#124; grep -P '\d{8}/' &#124; sed 's/.$//'`
for i in $dirs;do
#早于最早那天的，删除
    if test $i -le $oldest
    then
        tmp_dir=${workdir}/$i
#记录此次操作的记录
        echo &#34;Directory '$tmp_dir' deleted at `date '+%Y-%m-%d %H:%M:%S'`&#34; &#62;&#62; ${workdir}/delete.log
  [...]]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/289/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>该死的DOMDocument!</title>
		<link>http://www.phpman.com.cn/archives/275</link>
		<comments>http://www.phpman.com.cn/archives/275#comments</comments>
		<pubDate>Thu, 24 Sep 2009 06:37:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[DOM]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=275</guid>
		<description><![CDATA[PHP处理XML类文档主要有两个模块，一般简单点用SimpleXML,不过他只能作遍历、取值、取属性等操作，而不能进行删除修改节点的操作。使用libxml的DOMDocument功能比较强大，不过也比较麻烦。今天就遇见一问题，折腾很久～
有XML格式如下:

&#60;foo xmlns=&#34;test&#34;&#62;
&#60;bar attr='a'&#62;&#60;/bar&#62;
&#60;bar attr='b'&#62;&#60;/bar&#62;
&#60;bar attr='c'&#62;&#60;/bar&#62;
&#60;/foo&#62;

开始尝试解析

&#60;?php
    $dom = new DOMDocument;
    $dom-&#62;loadXML&#40;$xmls&#41;;//xmls变量为以上XML的字符串内容
    $messages = $dom-&#62;getElementsByTagName&#40;'bar'&#41;;
    foreach&#40;$messages as $k=&#62;$message&#41;&#123;
        if&#40;!is_object&#40;$message&#41; &#124;&#124; &#40;$message-&#62;getAttribute&#40;'attr'&#41; == 'a'&#41;&#41;&#123;
            continue;//属性attr 为a的保留   [...]]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/275/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>将linux文件同步至windows下实现自动备份</title>
		<link>http://www.phpman.com.cn/archives/245</link>
		<comments>http://www.phpman.com.cn/archives/245#comments</comments>
		<pubDate>Tue, 23 Jun 2009 12:47:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[system related]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=245</guid>
		<description><![CDATA[对站长来说，丢失数据又没得恢复绝对是恶梦……因此，想到将linux下的数据库和www目录自动备份，因为有win主机闲置，那就存它那了。闲话少说，现在开工:
首先给win主机安装cwrsync(基于cgwin和rsync的同步软件)
…………]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/245/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>memcache实践小记</title>
		<link>http://www.phpman.com.cn/archives/243</link>
		<comments>http://www.phpman.com.cn/archives/243#comments</comments>
		<pubDate>Tue, 23 Jun 2009 11:06:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[system related]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=243</guid>
		<description><![CDATA[memcache是一个高效快速的,以内存存取的高速缓存，其保存方式通过“键”＝&#62;“值”的方式，对key进行hash存储，因而查询速度快，避免硬盘的反复擦写,也正如此，断电或重启就得重新为它“灌”内容了。
准备工作:
1.先安装libevent,因为memcached是依赖它的
2.memcached下载与安装
# ./memcached -d -m 50 -p 11211 -u root
参数说明 -m 指定使用多少兆的缓存空间；-p 指定要监听的端口； -u 指定以哪个用户来运行
3.启动./memcached -p 11211 如果报如下错
error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
那么,注册一下libevent扩展
# vi /etc/ld.so.conf.d/libevent-i386.conf
内容为你编译生成的libevent库的路径，默认为/usr/local/lib
运行
# ldconfig
好了，这样memcachd就装好了，接下来安装php支持,可以通过phpize或静态编译方式 ，我是通过后者
下载最新版pecl memcache包解压至phpdir/ext
#rm configure
#buildconf &#8211;force 当然这个需要
#./configure &#8211;with-memcache &#8211;enable-memcache
需要注意: 要运行“buildconf”脚本，需要 autoconf ，如果没有或版 本过低就先升级它
OK,写几行试试～

&#60;?php
set_time_limit&#40;1000&#41;;
$host = 'localhost';
$memcache = new Memcache;
$memcache-&#62;connect&#40;$host,11211&#41;;
&#160;
for&#40;$i=0;$i&#60;100000;$i++&#41;&#123;
/*存上10w个看看*/
    $memcache-&#62;set&#40;'k'.$i,$i,false,1000&#41;;
&#125;
&#160;
print_r&#40;$memcache-&#62;getServerStatus&#40;$host&#41;&#41;;
print_r&#40;$memcache-&#62;getStats&#40;&#41;&#41;;//查看memcached服务状态
?&#62;

]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/243/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>各种工具(语言)之正则表达式语法差异比较</title>
		<link>http://www.phpman.com.cn/archives/222</link>
		<comments>http://www.phpman.com.cn/archives/222#comments</comments>
		<pubDate>Sat, 20 Jun 2009 01:07:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[正则语法]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[正则]]></category>

		<guid isPermaLink="false">http://www.phpman.com.cn/?p=222</guid>
		<description><![CDATA[这里对几种常用正则grep、egrep、sed要、awk、perl、vim、javascript等差异作个总结，希望一同补充完善……]]></description>
		<wfw:commentRss>http://www.phpman.com.cn/archives/222/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
