PHPѧϰ(8) ÒýÓÃ×Ö·û´®³£Á¿
ÔÚPHPÖУ¬ÓÐÈýÖÖ·½·¨À´¶¨ÒåÒ»¸ö×Ö·û´®³£Á¿¡£¼´µ¥ÒýºÅ¡¢Ë«ÒýºÅÒÔ¼°À´×ÔÓÚUnix ShellµÄhereÎĵµ¡£
ÔÚ½éÉÜÈýÖÖ¶¨Òå·½·¨Ö®Ç°£¬ÏȽéÉÜÒ»¸ö±äÁ¿×ª»»¡£ÔÚPHPÖУ¬Ë«ÒýºÅÒÔ¼°À´×ÔÓÚUnix ShellµÄhereÎĵµ¶¨Ò壬¶¼»á°Ñ×Ö·û´®µÄ±äÁ¿×ª»»Îª±äÁ¿µÄÖµ¡£ÆäÖУ¬×ÖÌå´®µÄ±äÁ¿Ò²¿ÉÒÔÓôóÀ¨ºÅ{}À¨ÆðÀ´£¬ÒÔʾÃ÷ÏÔ¡£
ҪעÒâµÄÊÇÔÚµ¥ÒýºÅ×Ö·û´®ÀïÊÇûÓбäÁ¿×ª»»µÄ¡£
ÈçÏ´úÂ룺
$name = 'yutuo'; // µ¥ÒýºÅ×Ö·û´® echo 'My name is $name'; // µ¥ÒýºÅ×Ö·û´® echo "My name is $name"; echo "My name is {$name}"; // hereÎĵµ×Ö·û´® echo <<< end My name is $name My name is {$name} end; Æä½á¹ûΪ(Êä³öûÓÐÈκλ»ÐУ¬ÎªÁËÈÝÒ×Àí½â£¬ÎÒÔÚ½á¹ûÀï»»ÐÐÁË)£ºMy name is $name My name is yutuo My name is yutuo My name is yutuo My name is yutuo
ÏÂÃæ·Ö±ð¶Ôµ¥ÒýºÅ¡¢Ë«ÒýºÅÒÔ¼°À´×ÔÓÚUnix ShellµÄhereÎĵµÕâÈýÖÖ¶¨Òå·½·¨½øÐнéÉÜ¡£
1. µ¥ÒýºÅ×Ö·û´®
µ¥ÒýºÅ×Ö·û´®Ö¸Óõ¥ÒýºÅÀ¨ÆðÀ´µÄ×Ö·û´®¡£ËüÖ»Ö§³ÖÁ½ÖÖתÒå·û£¬·´Ð±Ïß(\)ÒÔ¼°µ¥ÒýºÅ(¡®)£¬ËüÃÇ·Ö±ðÒÔ(\\)ºÍ(\¡¯)À´±íʾ¡£
ҪעÒâµÄÊǵ¥ÒýºÅ×Ö·û´®²»Ö§³Ö(\n)ÕâÖÖ»»Ðз½Ê½£¬µ«µ¥ÒýºÅ×Ö·û´®¿ÉÒÔ¿çÐж¨Òå¡£ÈçÏ´úÂ룺
echo 'My name is yutuo. I am studing PHP.';Æä½á¹ûΪ(Êä³ö½á¹ûÓл»ÐÐ)£º
My name is yutuo. I am studing PHP.2. Ë«ÒýºÅ×Ö·û´®
Ë«ÒýºÅ×Ö·û´®Ö¸ÓÃË«ÒýºÅÀ¨ÆðÀ´µÄ×Ö·û´®¡£ËüÖ»Ö§³Ö¶àÖÖתÒå·û£¬Ò²¿ÉÒÔ¿çÐж¨Òå¡£ÊéÀï˵ÓдóÀ¨ºÅºÍÖÐÀ¨ºÅ£¬µ«ÎÒÔÚPHP5.3.1ϲâÊÔÊÇûÓеġ£ÆäÖ§ÐеÄתÒå×Ö·ûÁбíÈçÏ£º
\" Ë«ÒýºÅ \n »»ÐÐ \r »Ø³µ \t ÖƱí·û \\ ·´Ð±Ïß \$ ÃÀÔª·û \000~777 °Ë½øÖÆASCIIÂë \x00~FF Ê®Áù½øÖÆASCIIÂë3. hereÎĵµ
hereÎĵµ¿ÉÒÔºÜÈÝÒ×½«¶àÐÐÎÄ×ַŽø³ÌÐò¡£³ýÁ˶¨Òå·½·¨²»Í¬Í⣬ËüµÄתÒå×Ö·ûÒÔ¼°¿çÐж¨ÒåºÍË«ÒýºÅ×Ö·û´®ÊÇÍêÈ«Ò»ÑùµÄ¡£
Æ䶨Òå·½·¨Îª <<< ±êʶ·û£¬½áβÔÙÒÔµ¥Ðбêʶ·û½áβ¡£Òª×¢ÒâµÄÊÇ<<<ºÍ±êʶ·ûÖ®¼äÓÐÒ»¸ö¿Õ¸ñ£¬½áβ±êʶ·ûÇ°²»ÄÜÓпոñ¡£
²Î¿¼´úÂë¿ÉÒÔ¿´¿´×îÇ°ÃæµÄ¡£
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ