PHP µãÔËËã·û£¨.£©ÓëÊý¾ÝÀàÐÍת»»µÄÉîÈë̽ÌÖ
Èç¹û¹À¼Æû´í£¬ÔÚ PHP ÓïÑÔÖУ¬Ê¹ÓÃ×î¶àµÄÔËËã·ûºÅµ±ÊýµãÔËËã·ûºÅ“.”£¬Ê¹ÓÃ×î¶àµÄÓï¾äµ±Êý“echo”¡£²»ÄÑÀí½â£¬PHP µÄÄ¿±ê¾ÍÊÇÉú³É³¬Îı¾½Å±¾£¬¶ø³¬Îı¾½Å±¾¾ÍÊÇÓÉ×Ö·û´®×é³ÉµÄ£¬ËùÒÔ PHP ´¦Àí×î¶àµÄÊý¾Ýµ±ÊÇ×Ö·û´®£¬Òò´ËÁ¬½Ó×Ö·û´®µÄµãÔËËã·ûºÍÊä³ö×Ö·û´®µÄÓï¾ä“echo”¾Í±»¾³£Óõ½¡£
×î³£ÓõIJ»Ò»¶¨ÊÇ×îÊìϤµÄ¡£µ±ÎÒÃÇÇû÷ echo "...."; Óï¾äÊä³öÔËËã½á¹ûµÄʱºò£¬ÓÐ˸Ò˵×Ô¼ºÒѾ¶Ô×Ö·û´®¡¢µã·ûºÅÁËÈçÖ¸ÕÆ¡¢ÔËÓÃ×ÔÈçÁËÄØ£¿
±ÈÈ磬Óï¾ä echo '100'; ºÍ echo 100; Êä³öµÄ html ´úÂë½á¹û¶¼ÊÇ 100£¬ËûÃÇÓÐʲô²»Í¬£¿
ÔÙ±ÈÈ磬Óï¾ä echo 100.200; ºÍ echo 100[¿Õ¸ñ].[¿Õ¸ñ]200; Êä³ö½á¹ûÒ»ÑùÂð£¿ÎªÊ²Ã´£¿
……
1£¬Á˽â PHP ÊÇÒ»ÃÅ“ÈõÀàÐÍ”µÄÓïÑÔ
ÿÃżÆËã»úÓïÑÔ£¨ÎÒÖªµÀµÄ½«½ü20ÃÅÓïÑÔÖУ©£¬¶¼ÊÇÓÐÊý¾ÝÀàÐ͵ģ¬PHP ¸ÅĪÄÜÍâ¡£“ÈõÀàÐÍ”µÄÓïÑÔ²»ÊÇ˵¸ÃÓïÑÔûÓÐÊý¾ÝÀàÐÍ£¬¶øÊÇ˵ËüÈõ»¯»ò²»Ç¿µ÷Êý¾ÝÀàÐÍ£¬¾ßÌåµÄ˵£¬¾ÍÊDZäÁ¿ÔÚʹÓÃÇ°²»±ØÉùÃ÷Êý¾ÝÀàÐÍ£¬ÀàÐ͸ù¾ÝËù¸³ÖµµÄÀàÐÍÀ´¾ö¶¨£¬Í¬Ê±Ò²¶¨ÒåÁ˱äÁ¿±¾Éí¡£µ« PHP µÄº¯ÊýºÍ¸÷ÖÖ²Ù×÷·û£¨ÔËËã·û£©ÓÖÊÇÓбäÁ¿ºÍ²Ù×÷ÊýÀàÐÍÒªÇóµÄ¡£ËùÒÔ£¬²»¿É±ÜÃâµÄ£¬´æÔÚÒ»¸öÊý¾ÝÀàÐ͵Ä×Ô¶¯×ª»»ÎÊÌ⡣ǿÀàÐ͵ÄÓïÑÔ£¬±ÈÈç C¡¢C++¡¢Java¡¢C#£¬²»Í¬ÀàÐ͵ÄÊý¾ÝÊDz»ÔÊÐí²ÎÓë»ìºÏÔËËãµÄ£¬Èç¹ûÐèÒª£¬±ØÐèͨ¹ýһЩ·½·¨£¨±ÈÈ纯Êý¡¢ÀàµÄ·½·¨£©½øÐÐÀàÐÍת»»¡£µ« PHP ÊÇÔÊÐí²»Í¬ÀàÐ͵ÄÊý¾Ý½øÐлìºÏÔËËãµÄ(ÀàËÆ VbScript)£¬PHP ½âÊÍÒýÇæ×Ô¶¯×öÁËÀàÐÍת»»µÄ¹¤×÷¡£
2£¬Á˽â echo µÄ²Ù×÷Êý
echo ʵ¼ÊÉϲ»ÊÇÒ»¸öº¯Êý£¬¶øÊÇÒ»¸öÓïÑԽṹ£¬ËùÒÔËü¿ÉÒÔÓÃ³É echo('...')£¬Ò²¿ÉÒÔÓÃ³É echo '...'¡£echo µÄ²Ù×÷ÊýÀàÐÍÓ¦¸ÃÊÇ×Ö·û´®Ð͵ġ£
²Î¿¼ PHP ÊÖ²á¶Ô echo µÄ˵Ã÷£º
Óï·¨£ºecho(strings);
²ÎÊý strings ±ØÐè¡£
ÃèÊö£ºÒ»¸ö»ò¶à¸öÒª·¢Ë͵½Êä³öµÄ×Ö·û´®¡£
С֪ʶ1£º×¢Òâ echo ºÍ print º¯ÊýµÄÇø±ð£¬±ÈÈ磺
echo "123" . print("abc"); //Óï·¨ÕýÈ·£¬µ«Êä³ö²»ÊÇ123abc£¬¶øÊÇ abc1231
&nb
Ïà¹ØÎĵµ£º
php»ù´¡Ñ§Ï°ÒѾ²î²»¶àÁË,µ«ÊÇΪ¼ìÑé×Ô¼ºµÄѧϰÕÆÎÕÇé¿ö,°Ñphp»ù´¡ÖªÊ¶»Ø¹Ë¸´Ï°ÁËÒ»ÏÂ
µÚÒ»¸öPHP³ÌÐò
<?php
echo "Hello World!";
?>
1 ×¢ÊÍ
1.1¶àÐÐ
/*
xxxx
*/
1.2µ¥ÐÐ
//xxxxx
2. ¸³Öµ
$a = 'test';
2.1 ¼ì²é±äÁ¿ÊÇ·ñÒÑÉùÃ÷
isset($a)
2.2 ÊͷűäÁ¿
unset($a);
2.3 ¾² ......
PHP4:Ææ¼£±³ºó
1995Äêʱ£¬RasmusÔÚÓÃPHPдËûµÄ¸öÈËÖ÷Ò³£»½ñÌ죬PHP³ÉΪ·çÃÒÈ«ÇòµÄ½Å±¾ÓïÑÔ£¬Ô½À´Ô½¶àµÄÕ¾µãÑ¡ÔñʹÓÃPHP£¬Á¬Yahoo¶¼·ÅÆúÁË×Ô¼ºµÄ½Å±¾¶ø¸ÄÓÃPHPÖ§³ÖËüµÄÍøÕ¾¡£¿ÉÒÔ˵£¬PHPÊÇÒ»¸öÆæ¼£¡£ÎÒÒ»Ö±ÈÏΪ£¬ÈκÎÆæ¼£±³ºó¶¼ÓÐËüµÄÔÒò¡£ÏÖÔÚ£¬¾ÍÈÃÎÒÃÇ͸¹ýÕâ¸öÆæ¼££¬À´¿´¿´PHPµÄ³É¹¦Ö®µÀ¡£
1 ¼òµ¥Ò×ÓÃ
PHPµÄÈëÃÅÃż÷ ......
ÓÃPHPʵÏÖ¼òµ¥µÄÊý¾Ýץȡ
·½·¨Ò»£º
<?php
$urlstr = file_get_contents("http://www.baidu.com");
$urlstr = htmlspecialchars($urlstr);
print_r($urlstr);
?>
·½·¨¶þ£º£¨ÐèÒª´ò¿ªcurlÀ©Õ¹£©
×¢Ò⣺´ò¿ªcurlÀ©Õ¹Ê±£¬Ò»¶¨Òª¿´¿ ......
¡¾1¡¿Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿ get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá
½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª
(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
¡¡¡¡¡¾2 ......
Óõ¥ÒýºÅ´úÌæË«ÒýºÅÀ´°üº¬×Ö·û´®£¬ÕâÑù×ö»á¸ü¿ìһЩ¡£ÒòΪPHP»áÔÚË«ÒýºÅ°üΧµÄ×Ö·û´®ÖÐËÑÑ°±äÁ¿£¬µ¥ÒýºÅÔò²»»á£¬×¢Ò⣺ֻÓÐechoÄÜÕâô×ö£¬ËüÊÇÒ»ÖÖ¿ÉÒ԰Ѷà¸ö×Ö·û´®µ±×÷²ÎÊýµÄ“º¯Êý”£¨Òë×¢£ºPHPÊÖ²áÖÐ˵echoÊÇÓïÑԽṹ£¬²»ÊÇÕæÕýµÄº¯Êý£¬¹Ê°Ñº¯Êý¼ÓÉÏÁËË«ÒýºÅ£©¡£
1¡¢Èç¹ûÄܽ«ÀàµÄ·½·¨¶¨Òå³Éstatic£¬¾Í¾¡Á¿¶¨Ò ......