Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ѧϰPHP(1)

»ù±¾Óï·¨
ÎҵĵÚÒ»¸öPHP£ºHello World
<?php
echo"Hello World!";
?>
ÏÔʾ½á¹ûΪ Hello World!
±äÁ¿
PHPÖУ¬ËùÓеıäÁ¿¶¼ÒÔ±êʶ“$”¿ªÍ·:
<?php
$str1 = "Hello World!";
echo $str1;
?>
ÏÔʾ½á¹ûΪ Hello World!
PHPÖÐʹÓÓ.”·ûºÅÁ¬½Ó²»Í¬µÄ×Ö·û´®¡£¾ÙÀýÈçÏ£º
<?php
$Str1 = "Hello, ";
$Str2 = 5;
$Str3 = " OH.C!";
$Str2++;
echo "$Str1"."$Str2"."$Str3"."<br/>";
//Ò²¿ÉÒÔ
echo "$Str1 $Str2 $Str3 <br/>";
?>
ÏÔʾ½á¹ûΪ
Hello, 6 OH.C!
Hello, 6 OH.C!
Èç¹ûûÓÐÒýºÅ£¬Ð´³ÉÒÔÏÂÐÎʽ
<?php
$Str1 = "Hello, ";
$Str2 = 5;
$Str3 = " OH.C!";
$Str2++;
echo $Str1.$Str2.$Str3."<br/>"; //ÕýÈ·
echo $Str1 $Str2 $Str3 "<br/>"; //´íÎó
?>
PHP¶Ô¸÷ÖÖÔËËã·û¼°ÔËËã¹æÔò¶¼ÓÐÒ»Ì×ÍêÕûµÄ¹æ¶¨£¬Èç¹ûÓû§¾ßÓÐC»òC++ÓïÑԵıà³Ì±³¾°µÄ»°£¬¿ÉÒÔ·¢ÏÖÒ»Çж¼µÃÐÄÓ¦ÊÖ¡£
ÓëPerlÓïÑÔÒ»Ñù£¬ÔÚPHPÖУ¬Èç¹ûÔÚË«ÒýºÅ°üº¬µÄ×Ö·û´®Öк¬ÓбäÁ¿µÄ»°£¬¸Ã±äÁ¿½«ÓÃÏàÓ¦µÄ±äÁ¿ÖµÌæ»»£»Èç¹û×Ö·û´®±»µ¥ÒýºÅ°üº¬£¬Ôò²»×öÌæ»»¡£ÀýÈ磺
<?php
$MyName = "OH.C";
$Str1 = "Hello, $MyName";
$Str2 = 'Hello, $MyName';
echo "Str1: $Str1"."<br>";
echo "Str2: $Str2 <br>";
echo "--------------------<br>";
echo 'Str1: $Str1'.'<br>';
echo 'Str2: $Str2 <br>';
?>
ÏÔʾ½á¹ûΪ
Str1: Hello, OH.C
Str2: Hello, $MyName
--------------------
Str1: $Str1
Str2: $Str2
Êý×é
Óû§ÔÚʹÓÃPHP´´½¨Êý×éʱ£¬¿ÉÒÔ°ÑÊý×éË÷Òý£¨°üÀ¨³£¹æË÷Òý»ò¹ØÁªË÷Òý£©¼ÓÈë·½À¨ºÅÖС£ÀýÈ磺
<?php
$ArrStr1[0] = 'Hello!';
$ArrStr1[1] = 'How are you?';
echo $ArrStr1[0]."<br/>";
echo $ArrStr1[1]."<br/>";
echo"----------------------<br/>";
$ArrStr2['animal'] = 'tiger';
$ArrStr2['company'] = 'IBM';
echo $ArrStr2['animal']."<br/>";
echo $ArrStr2['company']."<br/>";
?>
ÏÔʾ½á¹ûΪ
Hello!
How are you?
----------------------
tiger
IBM
Èç¹ûÓû§ÔÚÏòÊý×鸳ֵʱ²»Ö¸Ã÷Êý×éϱ꣬PHP½«×Ô¶¯°Ñ¸Ã¶ÔÏó¼ÓÈëµ½Êý×éĩβ¡£ÀýÈç¶ÔÓÚÉÏÊö$$ArrStr1Êý×é¿ÉÒÔÓÃÒÔÏ·½Ê½¸³Öµ¶ø±£³Ö½á¹û²»±ä£¬
<?php
$ArrStr1[0] = 'Hello!';
$ArrStr1[1] = 'How are yo


Ïà¹ØÎĵµ£º

µÃµ½¿Í»§¶ËµÄ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Öг£ÓõÄ×Ö·û´®º¯Êý

¡¡PHPÖеÄ×Ö·û´®²Ù×÷¹¦ÄÜÊDZȽ϶àµÄ,ÖØÒªµÄÓÐÒÔÏÂÕâЩ:
¡¡¡¡(1)echo,print,printf,sprintf
¡¡¡¡Ç°Á½¸öº¯ÊýÊÇÊä³ö×Ö·û´®.×Ö·û´®ÖÐÈç¹ûÓбäÁ¿ÃûÔò±»Ìæ»»³ÉÆäÖµ. ºóÁ½¸öº¯ÊýÀàËÆÓÚCµÄͬÃûº¯Êý.
¡¡¡¡(2)strchr,strlen,strtok,strrchr,strrev,strstr,strtolower, strtoupper,substr,ucfirst
¡¡¡¡ÕâЩÊdz£ÓõÄ×Ö·û´®²Ù×÷º¯Êý, ......

PHPѹËõÓë½âѹËõPCLZIP(±ê×¼°æ)

<?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ÎļþÉÏ´«º¯Êý

<?php
/**
+++++++++++++++++++++=+++++ÉÏ´«Í¼Æ¬++++++++++++++++++++++++++++++++++++++++
—————————————————————————————&mdas ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ