A string is just a block of characters enclosed in quotes: letters, numbers, spaces, punctuation, etc.
All listed below are strings:
'Huige' "In watermelon sugar" '100' 'August 2, 2011'
FAQ:
【1】When creating a string, you can use single quotes or double quotes to encapsulate characters. In addition, the same type of quotes must be used at the beginning and end of the characters.
【2】If the same quotation mark appears in the middle of the string, you can place a backslash in front of the problematic character (the problematic character here is a double quotation mark, and you will learn about other problematic characters later) , which escapes:
<?php $var = "Define \"platitude\", please."; ?>
Another way is to use single quotes (this way you use single quotes when printing double quotes and vice versa):
<?php $var = 'Define "platitude", please.'; ?>
【3】If the same variable is assigned twice (for example: $book), the new value will overwrite the old value.
<?php $book = 'High Fidelity'; $book = 'The Corrections'; ?>
Print the result yourself so that you can verify whether the new value overwrites the old value.
I wrote the printing of variables here ====》》PHP entry variables