PHP & HTML uses the use of quotation marks

xiaoxiao2021-03-06  34

' : apostrophe

":Double quotes

1. When using single quotes output text, all of the contents of quotation is considered text,

EG:

$ FACE = "Interview Technology";

Echo ' $ face / n 9CBS blog ';

?>

// The code that prints to the page will be complete:

$ face / n

PS: This time, the variable $ FACE will only be directly output, instead of replacing the related value "interview technology", while escape the character "/ n" wrap, it will be directly output, not converted into target characters.

2. When using double quotes output text,

EG:

$ FACE = "Interview Technology";

Echo " $ face / n 9cbs blog ";

?>

// The code that prints to the page will be like this:

interview technology

9cbs blog

PS: Here we can see that when double quotes, the variable $ FACE is replaced with the variable "interview technology" when printing to the screen, and the "/ n" wrap symbol is also converted into a wrap. But this At the time, the double quotation number of the tag value in HTML is sensitive, so you can use / ", or you can use single quotes to replace the double quotes of the tag value in HTML, thus avoid symbol sensitive.

3. Looking at the difference between single-double quotes in the PHP page output, we can make reasonable all-in-one single quotes, when you use double quotes. Through your writing programs more efficient.

转载请注明原文地址:https://www.9cbs.com/read-63895.html

New Post(0)