Strings - Manual - PHP
Single quoted
The simplest way to specify a string is to enclose it in single quotes (the character ').
To specify a literal single quote, escape it with a backslash (\). To specify a literal backslash, double it (\\). All other instances of backslash will be treated as a literal backslash: this means that the other escape sequences you might be used to, such as \r or \n, will be output literally as specified rather than having any special meaning.
Note: Unlike the double-quoted and heredoc syntaxes, variables and escape sequences for special characters will not be expanded when they occur in single quoted strings.
Example #1 Syntax Variants
<?phpecho 'this is a simple string', PHP_EOL;echo 'You can also have embedded newlines instrings this way as it isokay to do', PHP_EOL;// Outputs: Arnold once said: "I'll be back"echo 'Arnold once said: "I\'ll be back"', PHP_EOL;// Outputs: You deleted C:\*.*?echo 'You deleted C:\\*.*?', PHP_EOL;// Outputs: You deleted C:\*.*?echo 'You deleted C:\*.*?', PHP_EOL;// Outputs: This will not expand: \n a newlineecho 'This will not expand: \n a newline', PHP_EOL;// Outputs: Variables do not $expand $eitherecho 'Variables do not $expand $either', PHP_EOL;?>Từ khóa » N Php
-
PHP - How To Create A Newline Character? - Stack Overflow
-
Nl2br - Manual - PHP
-
Tính Tổng Các Số Nguyên Từ 0 Tới N Bằng PHP - GokiSoft
-
Tính Tổng Của Các Chữ Số Của Môt Số Nguyên N - Bài Tập PHP - VietTuts
-
Tính Giai Thừa Trong PHP - Bài Tập PHP Có Lời Giải - VietTuts
-
Các Toán Tử Trong PHP
-
PHP Nl2br() Function - W3Schools
-
Căn Bản PHP - Viblo
-
PHP - Vòng Lặp For Tính Tổng S(n) = 1 + 1/2 + 1/3 + 1/4 +… 1/n
-
Bài 3: Các Kiểu Dữ Liệu Và Phạm Vi Biến Trong PHP
-
How To Create A New Line In PHP - Tutorial Republic
-
\ R Và \ N Có Nghĩa Là Gì Trong PHP? - HelpEx
-
PHP Là Gì?
-
Những Kiến Thức Căn Bản Tổng Quan Về Lập Trình PHP