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

¡¾PHPϵÁн̡̳¿(4)——PHPµÄ±äÁ¿

ºÜÈÙÐÒÉÏƪÎÄÕ±»°æÖ÷ÍƼöµ½Ê×Ò³ÁË£¬ÐÄÀïËãÊǼ¤¶¯ÁËÒ»°Ñ£¬¼ÌÐøŬÁ¦Ñ§Ï°Öаɡ£±¾ÕÂÖ÷Òª½éÉÜPHPÖеıäÁ¿¡£Ö÷Òª°üÀ¨£ºÔ¤¶¨Òå±äÁ¿¡¢±äÁ¿·¶Î§¡¢¿É±ä±äÁ¿ÒÔ¼°PHPµÄÍⲿ±äÁ¿µÈ¡£
Ò»¡¢»ù´¡ÖªÊ¶
PHP ÖÐÒ»¸öÃÀÔª·ûºÅºóÃæ¸úÉÏÒ»¸ö±äÁ¿Ãû³Æ£¬¼´±íʾһ¸ö±äÁ¿¡£±äÁ¿µÄÃû³ÆÊǶԴóСдÃô¸ÐµÄ¡£
±äÁ¿ÃûÓë PHP ÖÐÆäËüµÄ±êÇ©Ò»Ñù×ñÑ­ÏàͬµÄ¹æÔò¡£Ò»¸öÓÐЧµÄ±äÁ¿ÃûÓÉ×Öĸ»òÕßÏ»®Ïß¿ªÍ·£¬ºóÃæ¸úÉÏÈÎÒâÊýÁ¿µÄ×Öĸ£¬Êý×Ö£¬»òÕßÏ»®Ïß¡£°´ÕÕÕý³£µÄÕýÔò±í´ïʽ£¬Ëü½«±»±íÊöΪ£º'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
×¢: ×ÖĸΪ a-z£¬A-Z£¬ASCII ×Ö·û´Ó 127 µ½ 255£¨0x7f-0xff£©¡£
<?php
$var = "Bob";
$Var = "Joe";
echo "$var, $Var"; // outputs "Bob, Joe"
$4site = 'not yet'; // invalid; starts with a number
$_4site = 'not yet'; // valid; starts with an underscore
$t?yte = 'mansikka'; // valid; 'ä§ is (Extended) ASCII 228.
?>
PHP 3 ÖУ¬±äÁ¿×ÜÊÇ´«Öµ¸³Öµ¡£ÄÇÒ²¾ÍÊÇ˵£¬µ±Ä㽫һ¸ö±í´ïʽµÄÖµ¸³ÓèÒ»¸ö±äÁ¿Ê±£¬Õû¸öԭʼ±í´ïʽµÄÖµ±»¸³Öµµ½Ä¿±ê±äÁ¿¡£ÕâÒâζ×Å£¬ÀýÈ磬µ±Ò»¸ö±äÁ¿µÄÖµ¸³ÓèÁíÍâÒ»¸ö±äÁ¿Ê±£¬¸Ä±äÆäÖÐÒ»¸ö±äÁ¿µÄÖµ£¬½«²»»áÓ°Ïìµ½ÁíÍâÒ»¸ö±äÁ¿¡£
PHP 4 ÌṩÁËÁíÍâÒ»ÖÖ·½Ê½¸ø±äÁ¿¸³Öµ£º´«µØÖ·¸³Öµ¡£ÕâÒâζ×ÅеıäÁ¿¼òµ¥µÄÒýÓ㨻»ÑÔÖ®£¬“³ÉΪÆä±ðÃû” »òÕß “Ö¸Ïò”£©ÁËԭʼ±äÁ¿¡£¸Ä¶¯ÐµıäÁ¿½«Ó°Ï쵽ԭʼ±äÁ¿£¬·´Ö®ÒàÈ»¡£ÕâͬÑùÒâζ×ÅÆäÖÐûÓÐÖ´Ðи´ÖƲÙ×÷£»Òò¶ø£¬ÕâÖÖ¸³Öµ²Ù×÷¸ü¼Ó¿ìËÙ¡£¾¡¹ÜÈç´Ë£¬ÈκÎÌáËٵIJÙ×÷Ö»ÓÐÔÚ½ôÃÜÑ­»·»òÕß´óÊý×é»òÕ߶ÔÏó²Å¿ÉÄܱ»×¢Òâµ½¡£
ʹÓô«µØÖ·¸³Öµ£¬¼òµ¥µØ×·¼ÓÒ»¸ö£¨&£©·ûºÅµ½½«Òª¸³ÖµµÄ±äÁ¿Ç°£¨Ô´±äÁ¿£©¡£ÀýÈ磬ÏÂÁдúÂëƬ¶ÏÁ½´ÎÊä³ö‘My name is Bob’£º
<?php
$foo = 'Bob'; // Assign the value 'Bob' to $foo
$bar = &$foo; // Reference $foo via $bar.
$bar = "My name is $bar"; // Alter $bar...
echo $bar;
echo $foo; // $foo is altered too.
?>
ÐèҪעÒâµÄÊÇÖ»ÓÐÃüÃû±äÁ¿²Å¿ÉÒÔ´«µØÖ·¸³Öµ£¬ÕâÒ»µã·Ç³£ÖØÒª¡£
<?php
$foo = 25;
$bar = &$foo; // This is a valid assignment.
$bar = &(24 * 7); // Invalid; references an unnamed expression.
function test()
{
return 25;
}
$bar = &test(); // Invali


Ïà¹ØÎĵµ£º

php½âÎöxmlʾÀý

<!-- xml ¸ñʽ
<books>
<book id='1001'>
<author>andylin</author>
<title>c language</title>
<publisher id="aaa">O'Reilly</publisher>
</book>

<book id='1002'>
<author>congfeng</author>
<t ......

php $_SERVERº¯ÊýÖÐQUERY_STRINGºÍREQUEST_URI

$_SERVER´æ´¢µ±Ç°·þÎñÆ÷ÐÅÏ¢£¬ÆäÖÐÓм¸¸öÖµÈç$_SERVER["QUERY_STRING"]£¬$_SERVER["REQUEST_URI"]£¬$_SERVER["SCRIPT_NAME"]ºÍ$_SERVER["PHP_SELF"]³£³£ÈÝÒ×»ìÏý£¬ÒÔÏÂͨ¹ýʵÀýÏê½â$_SERVERº¯ÊýÖÐQUERY_STRING£¬REQUEST_URI£¬SCRIPT_NAMEºÍPHP_SELF±äÁ¿Çø±ð£¬ÕÆÎÕÕâËÄÕßÖ®¼äµÄ¹Øϵ£¬±ãÓÚÔÚʵ¼ÊÓ¦ÓÃÖÐÕýÈ·»ñÈ¡ËùÐèÒªµÄÖµ
1£ ......

PHP SESSION Ô­Àí


Ò»¡¢PHP SESSIONÔ­Àí
ÎÒÃÇÖªµÀ£¬sessionÊÇÔÚ·þÎñÆ÷¶Ë±£³ÖÓû§»á»°Êý¾ÝµÄÒ»ÖÖ·½·¨£¬¶ÔÓ¦µÄcookieÊÇÔÚ¿Í»§¶Ë±£³ÖÓû§Êý¾Ý¡£HTTPЭÒéÊÇÒ»ÖÖÎÞ״̬ЭÒ飬·þ
ÎñÆ÷ÏìÓ¦ÍêÖ®ºó¾ÍʧȥÁËÓëä¯ÀÀÆ÷µÄÁªÏµ£¬×îÔ磬Netscape½«cookieÒýÈëä¯ÀÀÆ÷£¬Ê¹µÃÊý¾Ý¿ÉÒÔ¿Í»§¶Ë¿çÒ³Ãæ½»»»£¬ÄÇô·þÎñÆ÷ÊÇÈçºÎ¼ÇסÖÚ¶àÓû§
µÄ»á»°Êý¾ÝÄØ£¿
Ê×ÏÈÒª ......

ÕýÔò±í´ïʽÔÚphp£¬java£¬javascriptÖзֱðÓ¦ÓÃ

ÔÚjavascriptÖÐÓ÷¨¾ÙÀý
var rule = /^\d+$/;
if(!rule.test(addform.rmb_price.value)) {
alert('rmb_price must be number');
addform.rmb_price.focus();
return false;
}
ÔÚphpÖÐÓ÷¨¾ÙÀý
$aa = "/^\d+$/";
if(preg_match($aa, "111")) {
echo "found";
}
ÔÚjavaÖÐÓ÷¨¾ÙÀý ......

delphi ±àдµÄcom ¶ÔÏó ÓÃphpµ÷ÓõÄʵÀý

delphi ±àдµÄcom ¶ÔÏó ÓÃphpµ÷ÓÃ
µÄ
ʵÀý
delphi:
function Tmyxml.Get_xml: WideString;
begin
      Get_xml:='wo shi a lei!';
end;
function Tmyxml.Get_xmldata: WideString;
var
xmlStr:string;
begin
  xmlStr := '<?xml   version="1.0" & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ