PHP entry variable string, PHP entry variable
A string is just a piece of characters enclosed in quotation marks: letters, numbers, spaces, punctuation, and so on.
All of the following are strings:
?
1234 |
'Huige' "In watermelon sugar" '100' 'August 2, 2011' |
FAQ:
"1" When creating a string, you can enclose the character in single or double quotation marks, and you must use the same type of quotation marks at the beginning and end of the character.
"2" If the same quotation marks appear in the middle of the string, it can be escaped by placing a backslash before the problematic character (the character in question is a double quotation mark, and you will later learn about the other problematic character):
?
123 |
$var = "Define \"platitude\", please." ; ?> |
Another way is to use single quotation marks (this way is to use single quotes when printing double quotes, and vice versa):
?
123 |
$var = 'Define "platitude", please.' ; ?> |
"3" If the same variable is assigned a value of 2 times (for example: $book), the new value overrides the old value.
?
1234 |
$book = 'High Fidelity' ; $book = 'The Corrections' ; ?> |
The results are printed on their own, so that you can verify that the old values are not rewritten under the new values.
http://www.bkjia.com/PHPjc/1095122.html www.bkjia.com true http://www.bkjia.com/PHPjc/1095122.html techarticle a string of PHP entry variables, the PHP entry variable string is just a block of characters enclosed in quotation marks: letters, numbers, spaces, punctuation, and so on. All listed below are strings ...