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
Ïà¹ØÎĵµ£º
×÷ÓÃÊǰÑÐÎÈ磺www.abc.com/index.php/blog/show µÄµØÖ·ÃÀ»¯³É www.abc.com/blog/show ,ʹÓÃ$_SERVER['PATH_INFO']½ÓÊÕ±äÁ¿¡£
server
{
listen 80;
server_name myweb;
index index.html index.htm index.php;
root /home/zhaowei/code;
if (!-f $request_filename) {
......
µÃµ½¿Í»§¶ËµÄ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 ......
Ò». 1. ǶÈë·½·¨£º »òÕß 2. Ó¦ÓÃÎļþ£º £¨1£©require("MyRequireFile.php")£º·ÅÔÚphp³ÌÐòµÄ×îÇ°Ãæ£¬ÔÚphp³ÌÐòÖ´ÐÐǰÒýÈë £¨2£©include("MyIncludeFile.php")£º·ÅÔÚÁ÷³Ì¿ØÖƵĴ¦Àí²¿·Ö£¬ÔÚÔËÐе½includeʱÔÙ¶ÁÈ¡½øÀ´ 3. ×¢ÊÍ·½·¨£º »ìºÏCºÍ»ã±à£º// £¬/* */£¬ # 4. ±äÁ¿ÀàÐÍ£º £¨1£©PHP±äÁ¿Ò ......
<?php
include_once('include/pclzip.lib.php');
$archive = new PclZip('archive.zip');
//½âѹËõµ½extract/folder/Õâ¸öĿ¼ÖÐ
$list = $archive->extract(PCLZIP_OPT_PATH, "extract/folder/");
//Ôö¼ÓÕâ¸öĿ¼ÔÚѹËõµµÖУ¬Íê³ÉÒÔºóѹËõµµÀïÃæ»áÓÐbackupÕâ¸öĿ¼£¬backupÀïÃæ»áÓÐÕâÁ½¸öµµ°¸ ......
»ù±¾Óï·¨
ÎҵĵÚÒ»¸öPHP£ºHello World
<?php
echo"Hello World!";
?>
ÏÔʾ½á¹ûΪ Hello World!
±äÁ¿
PHPÖУ¬ËùÓеıäÁ¿¶¼ÒÔ±êʶ“$”¿ªÍ·:
<?php
$str1 = "Hello World!";
echo $str1;
?>
ÏÔʾ½á¹ûΪ Hello World!
PHPÖÐʹÓÓ.”·ûºÅÁ¬½Ó²»Í¬µÄ×Ö·û´®¡£¾ÙÀýÈçÏ£º
<?p ......