php鐨勫父閲忓強鍏舵暟鎹被鍨

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, LINEDIRFUNCTIONCLASSTRAITMETHODNAMESPACE

All posts

Other pages

鍙戣〃璇勮

鐢靛瓙閭欢鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢*鏍囨敞