php查询alexa排名的代码
Posted Jul 25th, 2008 by askie
1: <?PHP
2: /*
3: update: askie
4: Homepage: http://www.pkphp.com
5: email: askie@sohu.com
6: */
7: class Alexa
8: {
9: private $badclasses;
10: private $site;
11: private $cache;…
linux和windows下均可查询pr的php代码
Posted Jul 25th, 2008 by askie
1: <?php
2: // 7/25/2008 - Updated by Askie (http://www.pkphp.com/)
3: // 3/20/2008 - Updated by Roger Collins (http://www.rogercollins.com/)
4: // to remove graphing step
5:
6: //PageRank Lookup v1.1 by HM2K (update: 31/0…
PHP中htmlentities跟htmlspecialchars的区别
Posted Jun 30th, 2008 by askie
很多人都以为htmlentities跟htmlspecialchars的功能是一样的,都是格式化html代码的,我以前也曾这么认为,但是今天我发现并不是这样的。
这两个函数在格式化带有英文字符的html代码的时候基本没啥问题,但是htmlentities对中文字符也不放过,这样得出来的结果是中文字符 部分变为一堆乱码。当时做英文站的时候根本就没觉…
SCWS简易中文分词系统
Posted Jun 12th, 2008 by askie
SCWS-1.x.x 自述文件 (Written by hightman)
HomePage: http://www.hightman.cn
$Id: README,v 1.1.1.1 2008/03/04 14:00:36 hightman Exp $
> ———————————————————– <
1. 简介
2. 安装说明
3. API 使用说明
4. 配套工具
5. PHP 扩展安装说明
6. 代码…
memcache测试脚本
Posted Mar 29th, 2008 by askie
<?php
//连接
$mem = new Memcache;
$mem->connect(“127.0.0.1“, 11211);
//保存数据
$mem->set(‘key1‘, ‘This is first value‘, 0, 60);
$val = $mem->get(‘key1‘);
echo “Get key1 value: “ . $val .“<br>“;
//替换数据
$mem->replace(‘key1‘, ‘This is replace value‘, 0, 60);
$val = $mem->get(‘key1‘);
echo “Get key1 value: “ . $val . “<br>“;
//保存数组
$arr = array(‘aaa‘, ‘bbb‘, ‘ccc‘, ‘ddd‘);
$mem->set(‘key2‘, $arr, 0, 60);
$val2 = $mem->get(‘key2‘);
echo “Get key2 value: “;
print_r($val2);
echo “<br>“;
//删除数据
$mem->delete(‘key1‘);
$val = $mem->get(‘key1‘);
echo “Get key1 [...]