易截截图软件、单文件、免安装、纯绿色、仅160KB

BMH子串查找算法(PHP实现)

代码interface StringSearchable
{
    public function search($substring, $buffer);
}
class BoyerMooreStringSearch implements StringSearchable
{
    public $substring = null;
    public $buffer = '';
    public $jumpTable = array();
    protected $results = array();
    public function __construct()
    {    
        
    }
    public function __destruct()
    {
    }
    public function search($substring, $buffer)
    {    
        $this->results = array();
        $this->substring = $substring;
        $this->buffer = $buffer;
        $this->deriveJumpTable();
        
        $substringLen = strlen($this->substring);
        $currentCharIndex = $substringLen - 1;
        $bufferLen = strlen($this->buffer);
        while ($currentCharIndex < $bufferLen) {    
            for ($i = $substringLen - 1; $i >= 0; $i--) {
           &nb


相关文档:

PHP之$_SERVER用法详细

$_SERVER['PHP_SELF']                        #当前正在执行脚本的文件名,与 document root相关。
$_SERVER['argv']            &n ......

得到客户端的IP(php)

得到客户端的IP(php)
作者: laoyuanyyw 发表日期: 2006-08-01 10:43 文章属性: 原创 复制链接
function get_client_ip()
{
if(getenv('HTTP_CLIENT_IP'))
{
$client_ip = getenv('HTTP_CLIENT_IP');
}
elseif(getenv('HTTP_X_FORWARDED_FOR'))
{
$client_ip = getenv('HTTP_X_FORWARDED_FOR');
}
elseif ......

PHP编码规范

1 文件结构
|
|――images
|――include
  |――parameter
  |――config
  |――function
|――index
images存放图片文件,include中是系统是要引用的文件,一般在parameter中存放参数文件,config中存放配置文件,function中存放方法文件,如javascript的方法等,并按功能模块的分类,将各功能的类也放入其 ......

PHP 制作通讯录(一)

最近在学PHP ,觉得比较简单,可能是因为有一点编程经验的缘故吧,今天教大家用PHP制作通讯录,功能比较简单,第一次做网页教程,而且不是很有PHP经验,所以不足的地方大家留言告诉我,废话不多说,现在开始
环境:Windows XP SP3 + PHP5 + apache2 + mysql5
首先创建一个数据库,名为 MyDB (我这里使用的是MySQL),SQL ......

PHP 制作通讯录(二)

上一篇中,简单写了个Input.php , 但生日那一栏要自己手动输入写,比较麻烦,所以这里用到一个JS文件,可以选择日期
点击下载这个js文件
在Input.php文件最顶端引用这个JS文件
<script type="text/javascript" src="calenderJS.js"></script>
将生日的输入框改成
<input name="birthday" type="text" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号