phpÖÐsubstrµÄÓ÷¨Ïê½â
phpÖÐsubstrµÄÓ÷¨Ïê½â
php.netÖйØÓÚsubstrµÄ˵Ã÷ºÜ¼òµ¥:
start
If start is non-negative, the returned string will start at the start 'th position in string , counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth.
If start is negative, the returned string will start at the start 'th character from the end of string .
length
If length is given and is positive, the string returned will contain at most length characters beginning from start (depending on the length of string ). If string is less than or equal to start characters long, FALSE will be returned.
If length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when a start is negative). If start denotes a position beyond this truncation, an empty string will be returned.
ÏÂÃ棬ÎÒÏêϸ×ܽáһϹØÓÚsubstrµÄÏà¹ØÓ÷¨£º
ÔÐÍ£ºstring substr ( string $string , int $start [, int $length ] )£¬Ëü¿ÉÒÔÓÃÓÚÔÚÒ»¸ö½Ï³¤µÄ×Ö·û´®ÖвéÕÒÆ¥ÅäµÄ×Ö·û´®»ò×Ö·û¡£$stringΪËùÒª´¦ÀíµÄ×Ö·û´®£¬$startΪ¿ªÊ¼Ñ¡È¡µÄλÖã¬$lengthΪҪѡȡµÄ³¤¶È
Àý£º
<?php
//´Ë½Ì³ÌÀ´Ô´ÓÚ97xxoo½Ì³ÌÍø£¨[url=http://www.97xxoo.org]www.97xxoo.org[/url]£©
²é¿´ÍêÕûµÄ½Ì³ÌÇëµã£º[url=http://www.97xxoo.org/article/1/2008/20081115345.shtml]http://www.97xxoo.org/article/1/2008/20081115345.shtml[/url]
$rest1 = substr("abcdef", 0, 0); // returns ""
$rest2 = substr("abcdef", 0, 2); // returns "ab"
$rest3 = substr("abcdef", 0, -1); // returns "abcde"
$rest4 = substr("abcdef", 2,0); // returns ""
$rest5 = substr("abcdef", 2,2); // returns "cd"
$rest6 = substr("abcdef", 2, -1); // returns "cde"
$rest7 = substr("abcdef", -2,0); // returns ""
$rest8 = substr("abcdef", -2,2); // returns "ef"
$rest9 = substr("abcdef", -2,-1); // returns "e"
?>
$startÈç¹ûΪ·Ç¸ºÊý£¬ÔÚ×Ö·û´®ÖÐÒÔ0Ϊ¿ªÍ·´Ó×óÏòÓÒ¿ªÊ¼¼ÇÊý£¬[url=http://www.caoliushequ8.cn]²ÝÁñÉçÇø[/url]¼´0´ú±í×Ö·û"a"£¬1Ôò´ú±
Ïà¹ØÎĵµ£º
#apt-get install apache2
//°²×°apahce2
#apt-get install php5
//°²×°php5
#apt-get install mysql-server
//°²×°mysql·þÎñ¶Ë
#apt-get install mysql-myclient
//°²×°mysqlµÄ¿Í»§¶Ë
#apt-get install php-mysql
//°²×°php-mysqlµÄÁ¬½á
apache+php+mysql »·¾³ÒѾ´î½¨ºÃÁË
½«ÒÔϵķþÎñÖØÆôÒ»ÏÂ
#/et ......
<?php
/*
* Created on 2009-10-23
* ·Ö×ÓÈçÃÎo(╯¡õ╰)o
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
class people
{
private $name;
pu ......
µ±´¦Àí»ùÓÚXMLÓ¦ÓóÌÐòʱ£¬¿ª·¢Õß¾³£ÐèÒª½¨Á¢XML±àÂëÊý¾Ý½á¹¹¡£ÀýÈ磬WebÖлùÓÚÓû§ÊäÈëµÄXML״̬ģ°å£¬·þÎñÆ÷ÇëÇóXMLÓï¾ä£¬ÒÔ¼°»ùÓÚÔËÐÐʱ¼ä²ÎÊýµÄ¿Í»§ÏìÓ¦¡£
¾¡¹ÜXMLÊý¾Ý½á¹¹µÄ¹¹½¨±È½Ï·Ñʱ£¬µ«Èç¹ûʹÓóÉÊìµÄPHP DOMÓ¦ÓóÌÐò½Ó¿Ú£¬Ò»Çж¼»á±äµÃ¼òµ¥Ã÷ÁË¡£±¾ÎĽ«ÏòÄã½éÉÜPHP DOMÓ¦ÓóÌÐò½Ó¿ÚµÄÖ÷Òª¹¦ÄÜ£¬ÑÝʾÈçºÎÉú³É ......
mkdir /downloads
chown -R root:root /downloads
chmod -R 774 /downloads
Ò»¡¢°²×°Apache2
ÏÂÔصØÖ·£ºhttp://www.apache.org/ --> HTTP Server --> from a mirror
1. »ñÈ¡mysqlÔ´Âë
shell> cd /downloads
......
2008.12.13×¢£º¹ØÓÚSPLµÄautoloadµÄº¯ÊýÊֲᣬÇë²Î¿¼ SPLº¯ÊýÊÖ²á:
http://www.phpinternals.com/blog/2008/12/translate-refs-spl-functions/
(1) autoload»úÖƸÅÊö
ÔÚ
ʹÓÃPHPµÄOOģʽ¿ª·¢ÏµÍ³Ê±£¬Í¨³£´ó¼ÒÏ°¹ßÉϽ«Ã¿¸öÀàµÄʵÏÖ¶¼´æ·ÅÔÚÒ»¸öµ¥¶ÀµÄÎļþÀÕâÑù»áºÜÈÝÒ×ʵÏÖ¶ÔÀà½øÐи´Óã¬Í¬Ê±½«À´ ......