1锛宲hp瀛楃涓插彲浠ョ敤鍝笁绉嶅畾涔夋柟寮忥紝浠栦滑鐨勫尯鍒槸浠涔堬紵
鍗曞紩鍙凤紝鍙屽紩鍙凤紝heredoc锛宯ewdoc銆
鍗曞紩鍙涓嶈兘瑙f瀽鍙橀噺锛屽彧鑳借В鏋愬崟寮曞彿鍜屽弽鏂滄潬鏈韩锛屽
<?php
$a = '\'';
$b = '\\';
// 杈撳嚭涓 ''','\'
?>
鐒跺悗鍗曞紩鍙峰彉閲忎笌鍙橀噺锛屽瓧绗︿覆鍜屽瓧绗︿覆锛屽彉閲忓拰瀛楃涓蹭箣闂村彲浠ョ敤.
鏉ラ摼鎺ャ
鍙屽紩鍙鍙互瑙f瀽鎵鏈夌殑杞箟瀛楃鐨勶紝濡
杞箟瀛楃
搴忓垪 鍚箟
\n 鎹㈣锛圓SCII 瀛楃闆嗕腑鐨 LF 鎴 0x0A (10)锛
\r 鍥炶溅锛圓SCII 瀛楃闆嗕腑鐨 CR 鎴 0x0D (13)锛
\t 姘村钩鍒惰〃绗︼紙ASCII 瀛楃闆嗕腑鐨 HT 鎴 0x09 (9)锛
\v 鍨傜洿鍒惰〃绗︼紙ASCII 瀛楃闆嗕腑鐨 VT 鎴 0x0B (11)锛夛紙鑷 PHP 5.2.5 璧凤級
\e Escape锛圓SCII 瀛楃闆嗕腑鐨 ESC 鎴 0x1B (27)锛夛紙鑷 PHP 5.4.0 璧凤級
\f 鎹㈤〉锛圓SCII 瀛楃闆嗕腑鐨 FF 鎴 0x0C (12)锛夛紙鑷 PHP 5.2.5 璧凤級
\ 鍙嶆枩绾
\$ 缇庡厓鏍囪
\” 鍙屽紩鍙
涔熷彲浠ヨВ鏋愬彉閲忥紝濡
<?php
$a = '\'';
$b = '\\';
// 杈撳嚭涓 ''','\'
$c = "{$b}";
// 杈撳嚭涓'''
?>
褰撶劧锛屽崟寮曞彿瑙f瀽杩樻槸姣旇緝蹇殑锛屾墍浠ワ紝濡傛灉鏈夊彉閲忕殑璇濓紝涔熶笉涓瀹氬氨瑕佺敤鍙屽紩鍙凤紝鍙互鐢ㄥ崟寮曞彿鍔.
锛屽
<?php
$a = '1111';
$b = 'aaa\''.$a.'\'';
heredoc鏈夌偣鍍忓弻寮曞彿锛宯ewdoc鏈夌偣鍍忓崟寮曞彿锛屼笉鍚岀殑鏄敤鏉ュ啓澶ф枃鏈殑瀛楃涓层侲oT,EoD閮藉彲浠ワ紝涓嬮潰鍒嗗埆鏄
heredoc
<?php
$str = <<<EoD
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;
newdoc
<?php
$str = <<<'EoD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;
鍥炲埌姝i锛宲hp鐨勬暟鎹被鍨嬶紝鏈川涓婃湁涓夊ぇ鏁版嵁绫诲瀷锛堟爣閲忥紝绗﹀悎锛岀壒娈婏級銆
娉ㄦ剰锛娴偣鍨涓嶈兘杩愮敤鍒版瘮杈冭繍绠椾腑锛屽0.1+0.7鍏跺疄鏄笉绛変簬0.8鐨勶紝鍥犱负鍗佽繘鍒惰浆浜岃繘鍒剁殑鏃跺欙紝绮惧害浼氫涪澶便
甯冨皵绫诲瀷
false鐨勪竷绉嶇被鍨
0,0.0,’ ‘锛宖alse,NULL,array(),’0’鍒嗗埆鏄
鏁村瀷0锛屾诞鐐0锛岀┖瀛楃涓诧紝甯冨皵false锛孨ULL锛岀┖鏁扮粍锛0瀛楃涓
鏁扮粍绫诲瀷
瓒呭叏灞鏁扮粍
$_GLOBALS
,$_POST
,$_GET
,$_REQUSET
,$_SESSION
,$_COOKIE
,**棰勫畾涔夊父閲 **
FILE, LINE锛DIR锛FUNCTION锛CLASS锛TRAIT锛METHOD锛NAMESPACE
鍙戣〃鍥炲