PHP支持两种类型的字符串,这些字符串用引号说明。
1.如果希望赋值一个字面意义的字符串,精确保存这个字符串的内容,应该用单引号标注,例如:
-
1 $info=‘You are my $sunshine‘; 2 echo $info;
此时会显示You are my $sunshine,单引号中的每个字符都赋值给变量$info。
2.当字符串中包含一个变量时,可以使用双引号标注字符串,例如:
-
$sunshine=‘apple of my eyes‘; $info="You are my $sunshine"; echo $info;
此时PHP会替换变量的内容,则会显示You are my apple of my eyes
:first-child { margin-top: 0; } blockquote > :last-child { margin-bottom: 0; } img { border: 0; max-width: 100%; height: auto !important; margin: 2px 0; } table { border-collapse: collapse; border: 1px solid #bbbbbb; } td { padding: 4px 8px; border-collapse: collapse; border: 1px solid #bbbbbb; } @media screen and (max-width: 660px) { body { padding: 20px 18px; padding: 1.33rem 1.2rem; } } @media only screen and (-webkit-max-device-width: 1024px), only screen and (-o-max-device-width: 1024px), only screen and (max-device-width: 1024px), only screen and (-webkit-min-device-pixel-ratio: 3), only screen and (-o-min-device-pixel-ratio: 3), only screen and (min-device-pixel-ratio: 3) { html, body { font-size: 17px; } body { line-height: 1.7; padding: 0.75rem 0.9375rem; color: #353c47; } h1 { font-size: 2.125rem; } h2 { font-size: 1.875rem; } h3 { font-size: 1.625rem; } h4 { font-size: 1.375rem; } h5 { font-size: 1.125rem; } h6 { color: inherit; } ul, ol { padding-left: 2.5rem; } blockquote { padding: 0 0.9375rem; } }
-->
:first-child { margin-top: 0;}blockquote > :last-child { margin-bottom: 0;}img { border: 0; max-width: 100%; height: auto !important; margin: 2px 0;}table { border-collapse: collapse; border: 1px solid #bbbbbb;}td { padding:4px 8px; border-collapse: collapse; border: 1px solid #bbbbbb;}@media screen and (max-width: 660px) { body { padding: 20px 18px; padding: 1.33rem 1.2rem; }}@media only screen and (-webkit-max-device-width: 1024px), only screen and (-o-max-device-width: 1024px), only screen and (max-device-width: 1024px), only screen and (-webkit-min-device-pixel-ratio: 3), only screen and (-o-min-device-pixel-ratio: 3), only screen and (min-device-pixel-ratio: 3) { html, body { font-size: 17px; } body { line-height: 1.7; padding: 0.75rem 0.9375rem; color: #353c47; } h1 { font-size: 2.125rem; } h2 { font-size: 1.875rem; } h3 { font-size: 1.625rem; } h4 { font-size: 1.375rem; } h5 { font-size: 1.125rem; } h6 { color: inherit; } ul, ol { padding-left: 2.5rem; } blockquote { padding: 0 0.9375rem; }}
-->