<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>个人学习php技术分享</title><link>https://www.th-hy.cn/</link><description>个人学习php技术分享</description><item><title>PHP 完整表单实例</title><link>https://www.th-hy.cn/?id=23</link><description>&lt;h1 style=&quot;border: 0px; margin: 0px 0px 10px; padding: 0px; font-size: 2.1em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP&amp;nbsp;&lt;span class=&quot;color_h1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: var(--color-primary-dark);&quot;&gt;完整表单实例&lt;/span&gt;&lt;/h1&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;本章节将介绍如何让用户在点击&amp;quot;提交（submit）&amp;quot;按钮提交数据前保证所有字段正确输入。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 在表单中确保输入值&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在用户点击提交按钮后，为确保字段值是否输入正确，我们在HTML的input元素中插添加PHP脚本， 各字段名为: name, email, 和 website。 在备注中的 textarea 字段中，我们将脚本放于 &amp;lt;textarea&amp;gt; 和 &amp;lt;/textarea&amp;gt; 标签之间。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP脚本输出值为： $name, $email, $website, 和 $comment 变量。&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;然后，我们同样需要检查被选中的单选按钮， 对于这一点，我们 必须设置好checked属性(不是radio按钮的 value 属性) :&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;htmlspecialchars($_SERVER[&amp;quot;PHP_SELF&amp;quot;]);?&amp;gt;&amp;quot;&amp;gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;名字:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;name&amp;quot;&amp;nbsp;value=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$name;?&amp;gt;&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;*&amp;nbsp;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$nameErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;E-mail:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;email&amp;quot;&amp;nbsp;value=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$email;?&amp;gt;&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;*&amp;nbsp;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$emailErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;网址:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;website&amp;quot;&amp;nbsp;value=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$website;?&amp;gt;&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$websiteErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;备注:&amp;nbsp;&amp;lt;textarea&amp;nbsp;name=&amp;quot;comment&amp;quot;&amp;nbsp;rows=&amp;quot;5&amp;quot;&amp;nbsp;cols=&amp;quot;40&amp;quot;&amp;gt;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$comment;?&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;性别:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;radio&amp;quot;&amp;nbsp;name=&amp;quot;gender&amp;quot;&amp;nbsp;&amp;lt;?php&amp;nbsp;if&amp;nbsp;(isset($gender)&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;$gender==&amp;quot;female&amp;quot;)&amp;nbsp;echo&amp;nbsp;&amp;quot;checked&amp;quot;;?&amp;gt;&amp;nbsp;&amp;nbsp;value=&amp;quot;female&amp;quot;&amp;gt;女
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;radio&amp;quot;&amp;nbsp;name=&amp;quot;gender&amp;quot;&amp;nbsp;&amp;lt;?php&amp;nbsp;if&amp;nbsp;(isset($gender)&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;$gender==&amp;quot;male&amp;quot;)&amp;nbsp;echo&amp;nbsp;&amp;quot;checked&amp;quot;;?&amp;gt;&amp;nbsp;&amp;nbsp;value=&amp;quot;male&amp;quot;&amp;gt;男
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;*&amp;nbsp;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$genderErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;submit&amp;quot;&amp;nbsp;name=&amp;quot;submit&amp;quot;&amp;nbsp;value=&amp;quot;Submit&amp;quot;&amp;gt;&amp;nbsp;
&amp;lt;/form&amp;gt;&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 完整表单实例&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下是完整的PHP表单验证实例代码：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code notranslate&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;&lt;a class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_form_validation_complete&quot; target=&quot;_blank&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:59:13 +0800</pubDate></item><item><title>PHP 表单 - 验证邮件和URL</title><link>https://www.th-hy.cn/?id=22</link><description>&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;本章节我们将介绍如何验证 names(名称), e-mails（邮件）, 和 URLs。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 验证名称&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下代码将通过简单的方式来检测 name 字段是否包含字母和空格，如果 name 字段值不合法，将输出错误信息：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;$name&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;name&amp;quot;]);if&amp;nbsp;(!preg_match(&amp;quot;/^[a-zA-Z&amp;nbsp;]*$/&amp;quot;,$name))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;$nameErr&amp;nbsp;=&amp;nbsp;&amp;quot;只允许字母和空格&amp;quot;;&amp;nbsp;}&lt;/pre&gt;&lt;table class=&quot;lamp&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 10px; font-size: 14px; color: rgb(0, 0, 0); background-color: var(--color-bg-white); width: 34px;&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/images/lamp.jpg&quot; alt=&quot;Note&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: 32px; width: 32px;&quot;/&gt;&lt;/th&gt;&lt;td style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 4px; padding-bottom: 4px; padding-left: 0px; font-size: 14px; background-color: var(--color-bg-white);&quot;&gt;preg_match — 进行正则表达式匹配。&lt;br/&gt;&lt;br/&gt;语法：&lt;br/&gt;&lt;p style=&quot;border: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;int preg_match ( string $pattern , string $subject [, array $matches [, int $flags ]] )&lt;/strong&gt;&lt;/p&gt;&lt;br/&gt;在 subject 字符串中搜索与 pattern 给出的正则表达式相匹配的内容。如果提供了 matches ，则其会被搜索的结果所填充。$matches[0] 将包含与整个模式匹配的文本，$matches[1] 将包含与第一个捕获的括号中的子模式所匹配的文本，以此类推。&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br style=&quot;color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(250, 250, 248);&quot;/&gt;&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 验证邮件&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下代码将通过简单的方式来检测 e-mail 地址是否合法。如果 e-mail 地址不合法，将输出错误信息：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;$email&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;email&amp;quot;]);if&amp;nbsp;(!preg_match(&amp;quot;/([\w\-]+\@[\w\-]+\.[\w\-]+)/&amp;quot;,$email))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;$emailErr&amp;nbsp;=&amp;nbsp;&amp;quot;非法邮箱格式&amp;quot;;&amp;nbsp;}&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 验证 URL&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下代码将检测URL地址是否合法 (以下正则表达式运行URL中含有破折号:&amp;quot;-&amp;quot;)， 如果 URL 地址不合法，将输出错误信息：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;$website&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;website&amp;quot;]);if&amp;nbsp;(!preg_match(&amp;quot;/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&amp;amp;@#\/%?=~_|!:,.;]*[-a-z0-9+&amp;amp;@#\/%=~_|]/i&amp;quot;,$website))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;$websiteErr&amp;nbsp;=&amp;nbsp;&amp;quot;非法的&amp;nbsp;URL&amp;nbsp;的地址&amp;quot;;&amp;nbsp;}&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 验证 Name, E-mail, 和 URL&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;代码如下所示:&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;?php//&amp;nbsp;定义变量并默认设置为空值$nameErr&amp;nbsp;=&amp;nbsp;$emailErr&amp;nbsp;=&amp;nbsp;$genderErr&amp;nbsp;=&amp;nbsp;$websiteErr&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;$name&amp;nbsp;=&amp;nbsp;$email&amp;nbsp;=&amp;nbsp;$gender&amp;nbsp;=&amp;nbsp;$comment&amp;nbsp;=&amp;nbsp;$website&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;if&amp;nbsp;($_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;]&amp;nbsp;==&amp;nbsp;&amp;quot;POST&amp;quot;)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;name&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$nameErr&amp;nbsp;=&amp;nbsp;&amp;quot;Name&amp;nbsp;is&amp;nbsp;required&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$name&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;name&amp;quot;]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检测名字是否只包含字母跟空格
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(!preg_match(&amp;quot;/^[a-zA-Z&amp;nbsp;]*$/&amp;quot;,$name))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$nameErr&amp;nbsp;=&amp;nbsp;&amp;quot;只允许字母和空格&amp;quot;;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;email&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$emailErr&amp;nbsp;=&amp;nbsp;&amp;quot;Email&amp;nbsp;is&amp;nbsp;required&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$email&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;email&amp;quot;]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检测邮箱是否合法
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(!preg_match(&amp;quot;/([\w\-]+\@[\w\-]+\.[\w\-]+)/&amp;quot;,$email))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$emailErr&amp;nbsp;=&amp;nbsp;&amp;quot;非法邮箱格式&amp;quot;;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;website&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$website&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$website&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;website&amp;quot;]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;检测&amp;nbsp;URL&amp;nbsp;地址是否合法
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(!preg_match(&amp;quot;/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&amp;amp;@#\/%?=~_|!:,.;]*[-a-z0-9+&amp;amp;@#\/%=~_|]/i&amp;quot;,$website))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$websiteErr&amp;nbsp;=&amp;nbsp;&amp;quot;非法的&amp;nbsp;URL&amp;nbsp;的地址&amp;quot;;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;comment&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$comment&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$comment&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;comment&amp;quot;]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;gender&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$genderErr&amp;nbsp;=&amp;nbsp;&amp;quot;性别是必需的&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$gender&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;gender&amp;quot;]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;}}?&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:58:53 +0800</pubDate></item><item><title>PHP 表单 - 必需字段</title><link>https://www.th-hy.cn/?id=21</link><description>&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;本章节我们将介绍如何设置表单必需字段及错误信息。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 必需字段&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在上一章节我们已经介绍了表的验证规则，我们可以看到&amp;quot;名字&amp;quot;, &amp;quot;E-mail&amp;quot;, 和 &amp;quot;性别&amp;quot; 字段是必需的，各字段不能为空。&lt;/p&gt;&lt;table class=&quot;reference notranslate&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left; width: 182.844px;&quot;&gt;字段&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left; width: 606.547px;&quot;&gt;验证规则&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;名字&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;必需。 + 只能包含字母和空格&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;E-mail&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;必需。 + 必需包含一个有效的电子邮件地址（包含&amp;quot;@&amp;quot;和&amp;quot;.&amp;quot;）&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;网址&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;可选。 如果存在，它必需包含一个有效的URL&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;备注&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;可选。多行字段（文本域）。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;性别&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;必需。必需选择一个。&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;如果在前面的章节中，所有输入字段都是可选的。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在以下代码中我们加入了一些新的变量: $nameErr, $emailErr, $genderErr, 和 $websiteErr.。这些错误变量将显示在必需字段上。 我们还为每个$_POST变量增加了一个if else语句。 这些语句将检查 $_POST 变量是 否为空（使用php的 empty() 函数）。如果为空，将显示对应的错误信息。 如果不为空，数据将传递给test_input() 函数：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;?php
//&amp;nbsp;定义变量并默认设为空值
$nameErr&amp;nbsp;=&amp;nbsp;$emailErr&amp;nbsp;=&amp;nbsp;$genderErr&amp;nbsp;=&amp;nbsp;$websiteErr&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;
$name&amp;nbsp;=&amp;nbsp;$email&amp;nbsp;=&amp;nbsp;$gender&amp;nbsp;=&amp;nbsp;$comment&amp;nbsp;=&amp;nbsp;$website&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;

if&amp;nbsp;($_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;]&amp;nbsp;==&amp;nbsp;&amp;quot;POST&amp;quot;)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;name&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$nameErr&amp;nbsp;=&amp;nbsp;&amp;quot;名字是必需的。&amp;quot;;
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$name&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;name&amp;quot;]);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;email&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$emailErr&amp;nbsp;=&amp;nbsp;&amp;quot;邮箱是必需的。&amp;quot;;
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$email&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;email&amp;quot;]);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;website&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$website&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$website&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;website&amp;quot;]);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;comment&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$comment&amp;nbsp;=&amp;nbsp;&amp;quot;&amp;quot;;
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$comment&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;comment&amp;quot;]);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;if&amp;nbsp;(empty($_POST[&amp;quot;gender&amp;quot;]))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$genderErr&amp;nbsp;=&amp;nbsp;&amp;quot;性别是必需的。&amp;quot;;
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$gender&amp;nbsp;=&amp;nbsp;test_input($_POST[&amp;quot;gender&amp;quot;]);
&amp;nbsp;&amp;nbsp;}
}
?&amp;gt;&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP - 显示错误信息&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在以下的HTML实例表单中，我们为每个字段中添加了一些脚本， 各个脚本会在信息输入错误时显示错误信息。(如果用户未填写信息就提交表单则会输出错误信息):&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;htmlspecialchars($_SERVER[&amp;#39;PHP_SELF&amp;#39;]);?&amp;gt;&amp;quot;&amp;gt;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;名字:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;name&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;*&amp;nbsp;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$nameErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;E-mail:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;email&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;*&amp;nbsp;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$emailErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;网址:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;website&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$websiteErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;备注:&amp;nbsp;&amp;lt;textarea&amp;nbsp;name=&amp;quot;comment&amp;quot;&amp;nbsp;rows=&amp;quot;5&amp;quot;&amp;nbsp;cols=&amp;quot;40&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;性别:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;radio&amp;quot;&amp;nbsp;name=&amp;quot;gender&amp;quot;&amp;nbsp;value=&amp;quot;female&amp;quot;&amp;gt;女
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;radio&amp;quot;&amp;nbsp;name=&amp;quot;gender&amp;quot;&amp;nbsp;value=&amp;quot;male&amp;quot;&amp;gt;男
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;nbsp;class=&amp;quot;error&amp;quot;&amp;gt;*&amp;nbsp;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$genderErr;?&amp;gt;&amp;lt;/span&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;submit&amp;quot;&amp;nbsp;name=&amp;quot;submit&amp;quot;&amp;nbsp;value=&amp;quot;Submit&amp;quot;&amp;gt;&amp;nbsp;
&amp;lt;/form&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;&lt;a class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_form_validation_required&quot; target=&quot;_blank&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;查看代码 »&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:58:32 +0800</pubDate></item><item><title>PHP 表单验证</title><link>https://www.th-hy.cn/?id=20</link><description>&lt;div class=&quot;article-body&quot; style=&quot;border: 0px; margin: 0px; padding: 10px 10px 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;div class=&quot;article-intro&quot; id=&quot;content&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;本章节我们将介绍如何使用PHP验证客户端提交的表单数据。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP 表单验证&lt;/h2&gt;&lt;table class=&quot;lamp&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 10px; font-size: 14px; color: rgb(0, 0, 0); background-color: var(--color-bg-white); width: 34px;&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/images/lamp.jpg&quot; alt=&quot;Note&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: 32px; width: 32px;&quot;/&gt;&lt;/th&gt;&lt;td style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 4px; padding-bottom: 4px; padding-left: 0px; font-size: 14px;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;在处理PHP表单时我们需要考虑安全性。&lt;/strong&gt;&lt;p style=&quot;border: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em;&quot;&gt;本章节我们将展示PHP表单数据安全处理，为了防止黑客及垃圾信息我们需要对表单进行数据安全验证。&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;在本章节介绍的HTML表单中包含以下输入字段： 必须与可选文本字段，单选按钮，及提交按钮：&lt;/p&gt;&lt;iframe src=&quot;https://www.runoob.com/try/demo_source/demo_form_validation_complete.php&quot; width=&quot;690&quot; height=&quot;600&quot; seamless=&quot;&quot; style=&quot;border-width: 0px; border-style: initial; margin: 0px; padding: 0px;&quot;&gt;&lt;/iframe&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;&lt;a class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_form_validation_complete&quot; target=&quot;_blank&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;查看代码 »&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;上述表单验证规则如下：&lt;/p&gt;&lt;table class=&quot;reference&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left; width: 182.844px;&quot;&gt;字段&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left; width: 606.547px;&quot;&gt;验证规则&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;名字&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;必须。 +只能包含字母和空格&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;E-mail&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;必须。 + 必须是一个有效的电子邮件地址（包含&amp;#39;@&amp;#39;和&amp;#39;.&amp;#39;）&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;网址&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;可选。如果存在，它必须包含一个有效的URL&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;备注&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;可选。多行输入字段（文本域）&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;性别&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;必须。 必须选择一个&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;首先让我们先看看纯HTML的表单代码：&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;文本字段&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;&amp;quot;名字&amp;quot;, &amp;quot;E-mail&amp;quot;, 及&amp;quot;网址&amp;quot;字段为文本输入元素，&amp;quot;备注&amp;quot;字段是 textarea。HTML代码如下所示:&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;“名字”:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;name&amp;quot;&amp;gt;E-mail:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;email&amp;quot;&amp;gt;网址:&amp;nbsp;&amp;lt;input&amp;nbsp;type=&amp;quot;text&amp;quot;&amp;nbsp;name=&amp;quot;website&amp;quot;&amp;gt;备注:&amp;nbsp;&amp;lt;textarea&amp;nbsp;name=&amp;quot;comment&amp;quot;&amp;nbsp;rows=&amp;quot;5&amp;quot;&amp;nbsp;cols=&amp;quot;40&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;单选按钮&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;&amp;quot;性别&amp;quot;字段是单选按钮，HTML代码如下所示：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;性别:&amp;lt;input&amp;nbsp;type=&amp;quot;radio&amp;quot;&amp;nbsp;name=&amp;quot;gender&amp;quot;&amp;nbsp;value=&amp;quot;female&amp;quot;&amp;gt;女&amp;lt;input&amp;nbsp;type=&amp;quot;radio&amp;quot;&amp;nbsp;name=&amp;quot;gender&amp;quot;&amp;nbsp;value=&amp;quot;male&amp;quot;&amp;gt;男&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;表单元素&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;HTML 表单代码如下所示:&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;htmlspecialchars($_SERVER[&amp;quot;PHP_SELF&amp;quot;]);?&amp;gt;&amp;quot;&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;该表单使用&amp;nbsp;&lt;strong&gt;method=&amp;quot;post&amp;quot;&lt;/strong&gt;&amp;nbsp;方法来提交数据。&lt;/p&gt;&lt;table class=&quot;lamp&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 10px; font-size: 14px; color: rgb(0, 0, 0); background-color: var(--color-bg-white); width: 34px;&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/images/lamp.jpg&quot; alt=&quot;Note&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: 32px; width: 32px;&quot;/&gt;&lt;/th&gt;&lt;td style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 4px; padding-bottom: 4px; padding-left: 0px; font-size: 14px;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;什么是 $_SERVER[&amp;quot;PHP_SELF&amp;quot;] 变量?&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;$_SERVER[&amp;quot;PHP_SELF&amp;quot;]是超级全局变量，返回当前正在执行脚本的文件名，与 document root相关。&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;所以， $_SERVER[&amp;quot;PHP_SELF&amp;quot;] 会发送表单数据到当前页面，而不是跳转到不同的页面。&lt;/p&gt;&lt;table class=&quot;lamp&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 10px; font-size: 14px; color: rgb(0, 0, 0); background-color: var(--color-bg-white); width: 34px;&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/images/lamp.jpg&quot; alt=&quot;Note&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: 32px; width: 32px;&quot;/&gt;&lt;/th&gt;&lt;td style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 4px; padding-bottom: 4px; padding-left: 0px; font-size: 14px;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;什么是 htmlspecialchars()方法?&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;htmlspecialchars() 函数把一些预定义的字符转换为 HTML 实体。&lt;p style=&quot;border: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em;&quot;&gt;预定义的字符是：&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;&amp;amp; （和号） 成为 &amp;amp;amp;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;quot; （双引号） 成为 &amp;amp;quot;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;#39; （单引号） 成为 &amp;amp;#039;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt; （小于） 成为 &amp;amp;lt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;gt; （大于） 成为 &amp;amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br/&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP表单中需引起注重的地方？&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;$_SERVER[&amp;quot;PHP_SELF&amp;quot;] 变量有可能会被黑客使用！&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;当黑客使用跨网站脚本的HTTP链接来攻击时，$_SERVER[&amp;quot;PHP_SELF&amp;quot;]服务器变量也会被植入脚本。原因就是跨网站脚本是附在执行文件的路径后面的，因此$_SERVER[&amp;quot;PHP_SELF&amp;quot;]的字符串就会包含HTTP链接后面的JavaScript程序代码。&lt;/p&gt;&lt;table class=&quot;lamp&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 10px; font-size: 14px; color: rgb(0, 0, 0); background-color: var(--color-bg-white); width: 34px;&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/images/lamp.jpg&quot; alt=&quot;Note&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: 32px; width: 32px;&quot;/&gt;&lt;/th&gt;&lt;td style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 4px; padding-bottom: 4px; padding-left: 0px; font-size: 14px;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;XSS又叫 CSS (Cross-Site Script) ,跨站脚本攻击。恶意攻击者往Web页面里插入恶意html代码，当用户浏览该页之时，嵌入其中Web里面的html代码会被执行，从而达到恶意用户的特殊目的。&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;指定以下表单文件名为 &amp;quot;test_form.php&amp;quot;:&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;$_SERVER[&amp;quot;PHP_SELF&amp;quot;];?&amp;gt;&amp;quot;&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;现在，我们使用URL来指定提交地址 &amp;quot;test_form.php&amp;quot;,以上代码修改为如下所示:&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;test_form.php&amp;quot;&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;这样做就很好了。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;但是，考虑到用户会在浏览器地址栏中输入以下地址:&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;http://www.runoob.com/test_form.php/%22%3E%3Cscript%3Ealert(&amp;#39;hacked&amp;#39;)%3C/script%3E&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;以上的 URL 中，将被解析为如下代码并执行：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;test_form.php/&amp;quot;&amp;gt;&amp;lt;script&amp;gt;alert(&amp;#39;hacked&amp;#39;)&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;代码中添加了 script 标签，并添加了alert命令。 当页面载入时会执行该Javascript代码（用户会看到弹出框）。 这仅仅只是一个简单的实例来说明PHP_SELF变量会被黑客利用。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;请注意，&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;任何JavaScript代码可以添加在&amp;lt;script&amp;gt;标签中！&lt;/strong&gt;&amp;nbsp;黑客可以利用这点重定向页面到另外一台服务器的页面上，页面 代码文件中可以保护恶意代码，代码可以修改全局变量或者获取用户的表单数据。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;如何避免 $_SERVER[&amp;quot;PHP_SELF&amp;quot;] 被利用?&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;$_SERVER[&amp;quot;PHP_SELF&amp;quot;] 可以通过 htmlspecialchars() 函数来避免被利用。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;form 代码如下所示：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;&amp;lt;?php&amp;nbsp;echo&amp;nbsp;htmlspecialchars($_SERVER[&amp;quot;PHP_SELF&amp;quot;]);?&amp;gt;&amp;quot;&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;htmlspecialchars() 把一些预定义的字符转换为 HTML 实体。现在如果用户想利用 PHP_SELF 变量, 结果将输出如下所示：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;form&amp;nbsp;method=&amp;quot;post&amp;quot;&amp;nbsp;action=&amp;quot;test_form.php/&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;script&amp;amp;gt;alert(&amp;#39;hacked&amp;#39;)&amp;amp;lt;/script&amp;amp;gt;&amp;quot;&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;尝试该漏洞失败！&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;使用 PHP 验证表单数据&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;首先我们对用户所有提交的数据都通过 PHP 的 htmlspecialchars() 函数处理。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;当我们使用 htmlspecialchars() 函数时，在用户尝试提交以下文本域:&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;script&amp;gt;location.href(&amp;#39;http://www.runoob.com&amp;#39;)&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;该代码将不会被执行，因为它会被保存为HTML转义代码，如下所示：&lt;/p&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;amp;lt;script&amp;amp;gt;location.href(&amp;#39;http://www.runoob.com&amp;#39;)&amp;amp;lt;/script&amp;amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;以上代码是安全的，可以正常在页面显示或者插入邮件中。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;当用户提交表单时，我们将做以下两件事情：&lt;/p&gt;&lt;ol style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;使用 PHP trim() 函数去除用户输入数据中不必要的字符 (如：空格，tab，换行)。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;使用PHP stripslashes()函数去除用户输入数据中的反斜杠 (\)&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;接下来让我们将这些过滤的函数写在一个我们自己定义的函数中，这样可以大大提高代码的复用性。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;将函数命名为 test_input()。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;现在，我们可以通过test_input()函数来检测 $_POST 中的所有变量, 脚本代码如下所示：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 定义变量并默认设置为空值&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$email&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$gender&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$comment&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$website&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;REQUEST_METHOD&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;POST&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;test_input&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$email&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;test_input&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$website&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;test_input&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;website&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$comment&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;test_input&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;comment&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$gender&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;test_input&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;gender&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;test_input&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;trim&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;stripslashes&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;htmlspecialchars&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_form_validation_escapechar&quot; target=&quot;_blank&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;注意我们在执行以上脚本时，会通过$_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;]来检测表单是否被提交 。如果 REQUEST_METHOD 是 POST, 表单将被提交 - 数据将被验证。如果表单未提交将跳过验证并显示空白。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;在以上实例中使用输入项都是可选的，即使用户不输入任何数据也可以正常显示。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;在接下来的章节中我们将介绍如何对用户输入的数据进行验证。&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;previous-next-links&quot; style=&quot;border: 1px solid rgb(231, 234, 241); margin: 0px; padding: 10px 30px; line-height: 24px; overflow: hidden; background: rgb(251, 251, 251); color: rgb(133, 144, 166); font-size: 15px; box-shadow: rgba(0, 37, 55, 0.05) 0px 1px 3px; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal;&quot;&gt;&lt;div class=&quot;previous-design-link&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; float: left;&quot;&gt;&lt;a href=&quot;https://www.runoob.com/php/php-forms.html&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: grey; text-decoration-line: none; transition: opacity var(--transition-base);&quot;&gt;&lt;span class=&quot;fa fa-arrow-left&quot; aria-hidden=&quot;true&quot; style=&quot;display: inline-block; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 16px; line-height: 1; font-family: FontAwesome; text-rendering: auto; -webkit-font-smoothing: antialiased;&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:57:35 +0800</pubDate></item><item><title>PHP 表单和用户输入</title><link>https://www.th-hy.cn/?id=19</link><description>&lt;div class=&quot;article-body&quot; style=&quot;border: 0px; margin: 0px; padding: 10px 10px 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;div class=&quot;article-intro&quot; id=&quot;content&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;PHP 中的 $_GET 和 $_POST 变量用于检索表单中的信息，比如用户输入。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP 表单处理&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;有一点很重要的事情值得注意，当处理 HTML 表单时，PHP 能把来自 HTML 页面中的表单元素自动变成可供 PHP 脚本使用。&lt;/p&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em;&quot;&gt;实例&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;下面的实例包含了一个 HTML 表单，带有两个输入框和一个提交按钮。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;form.html 文件代码：&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;charset&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;utf-8&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;菜鸟教程(runoob.com)&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;welcome.php&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;名字: &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;年龄: &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;提交&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;当用户填写完上面的表单并点击提交按钮时，表单的数据会被送往名为 &amp;quot;welcome.php&amp;quot; 的 PHP 文件：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;welcome.php 文件代码：&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;欢迎&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;_POST&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;]; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;br&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;你的年龄是 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;_POST&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;]; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;nbsp;岁。&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;通过浏览器访问演示如下：&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/wp-content/uploads/2013/08/form1.gif&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: auto;&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;我们将在下一章中讲解 PHP 中的 $_GET 和 $_POST 变量。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP 获取下拉菜单的数据&lt;/h2&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em;&quot;&gt;PHP 下拉菜单单选&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;以下实例我们设置了下拉菜单三个选项，表单使用 GET 方式获取数据，action 属性值为空表示提交到当前脚本，我们可以通过 select 的 name 属性获取下拉菜单的值：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;php_form_select.php 文件代码：&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;? &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;htmlspecialchars&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ==&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;菜鸟教程&amp;lt;br&amp;gt;http://www.runoob.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ==&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Google 搜索&amp;lt;br&amp;gt;http://www.google.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ==&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;淘宝&amp;lt;br&amp;gt;http://www.taobao.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; 
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;选择一个站点:&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Runoob&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Google&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Taobao&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;提交&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em;&quot;&gt;PHP 下拉菜单多选&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;如果下拉菜单是多选的（ multiple=&amp;quot;multiple&amp;quot;），我们可以通过将设置 select&amp;nbsp;&lt;strong&gt;name=&amp;quot;q[]&amp;quot;&lt;/strong&gt;&amp;nbsp;以数组的方式获取，以下使用 POST 方式提交，代码如下所示：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;php_form_select_mul.php 文件代码：&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;? &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;is_array&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$sites&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;菜鸟教程: http://www.runoob.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Google 搜索: http://www.google.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;淘宝: http://www.taobao.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$val&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; PHP_EOL 为常量，用于换行&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$sites&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$val&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; 
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;multiple&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;multiple&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q[]&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;选择一个站点:&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Runoob&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Google&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Taobao&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;提交&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;单选按钮表单&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;PHP 单选按钮表单中 name 属性的值是一致的，value 值是不同的，代码如下所示：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;php_form_radio.php 文件代码：&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;? &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;htmlspecialchars&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ==&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;菜鸟教程&amp;lt;br&amp;gt;http://www.runoob.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ==&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Google 搜索&amp;lt;br&amp;gt;http://www.google.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ==&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;淘宝&amp;lt;br&amp;gt;http://www.taobao.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; 
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;radio&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Runoob &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;radio&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Google &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;radio&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Taobao &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;提交&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;checkbox 复选框&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;PHP checkbox 复选框可以选择多个值：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;php_form_select_checkbox.php 文件代码：&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;? &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;is_array&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$sites&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;菜鸟教程: http://www.runoob.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Google 搜索: http://www.google.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;淘宝: http://www.taobao.com&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$q&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$val&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; PHP_EOL 为常量，用于换行&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$sites&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$val&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; 
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;checkbox&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q[]&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;RUNOOB&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; Runoob&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;br&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; 
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;checkbox&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q[]&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;GOOGLE&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; Google&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;br&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; 
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;checkbox&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;q[]&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;TAOBAO&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; Taobao&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;br&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;提交&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;表单验证&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;我们应该尽可能的对用户的输入进行验证（通过客户端脚本）。浏览器验证速度更快，并且可以减轻服务器的压力。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;如果用户输入需要插入数据库，您应该考虑使用服务器验证。在服务器验证表单的一种好的方式是，把表单的数据传给当前页面（异步提交的方式更好），而不是跳转到不同的页面。这样用户就可以在同一张表单页面得到错误信息。用户也就&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</description><pubDate>Tue, 02 Jun 2026 07:57:02 +0800</pubDate></item><item><title>PHP 函数</title><link>https://www.th-hy.cn/?id=18</link><description>&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 的真正威力源自于它的函数。&lt;/p&gt;&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在 PHP 中，提供了超过 1000 个内建的函数。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 内建函数&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;如需查看所有数组函数的完整参考手册和实例，请访问我们的&amp;nbsp;&lt;a href=&quot;https://www.runoob.com/php/php-ref-array.html&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: rgb(0, 102, 0); transition: opacity var(--transition-base); outline: none;&quot;&gt;PHP 参考手册&lt;/a&gt;。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 函数&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在本章中，我们将为您讲解如何创建自己的函数。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;如要在页面加载时执行脚本，您可以把它放到函数里。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;函数是通过调用函数来执行的。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;你可以在页面的任何位置调用函数。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;创建 PHP 函数&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;函数是通过调用函数来执行的。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;语法&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;functionName&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 要执行的代码&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 函数准则：&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;函数的名称应该提示出它的功能&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;函数名称以字母或下划线开头（不能以数字开头）&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;实例&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;一个简单的函数，在其被调用时能输出我的名称：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;()
{ &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Kai Jim Refsnes&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;
} 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;My name is &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;输出：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;My&amp;nbsp;name&amp;nbsp;is&amp;nbsp;Kai&amp;nbsp;Jim&amp;nbsp;Refsnes&lt;/pre&gt;&lt;p&gt;&lt;br style=&quot;color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(250, 250, 248);&quot;/&gt;&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 函数 - 添加参数&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;为了给函数添加更多的功能，我们可以添加参数，参数类似变量。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;参数就在函数名称后面的一个括号内指定。&lt;/p&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;实例 1&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;下面的实例将输出不同的名字，但姓是相同的：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;($&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;)
{ &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt; Refsnes.&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;
} 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;My name is &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Kai Jim&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;My sister&amp;#39;s name is &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Hege&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;My brother&amp;#39;s name is &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Stale&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;输出：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;My&amp;nbsp;name&amp;nbsp;is&amp;nbsp;Kai&amp;nbsp;Jim&amp;nbsp;Refsnes.
My&amp;nbsp;sister&amp;#39;s&amp;nbsp;name&amp;nbsp;is&amp;nbsp;Hege&amp;nbsp;Refsnes.
My&amp;nbsp;brother&amp;#39;s&amp;nbsp;name&amp;nbsp;is&amp;nbsp;Stale&amp;nbsp;Refsnes.&lt;/pre&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;实例 2&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;下面的函数有两个参数：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;($&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;,$&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;punctuation&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;)
{ &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt; Refsnes&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;punctuation&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;
} 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;My name is &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Kai Jim&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;My sister&amp;#39;s name is &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Hege&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;My brother&amp;#39;s name is &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;writeName&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Ståle&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;输出：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;My&amp;nbsp;name&amp;nbsp;is&amp;nbsp;Kai&amp;nbsp;Jim&amp;nbsp;Refsnes.
My&amp;nbsp;sister&amp;#39;s&amp;nbsp;name&amp;nbsp;is&amp;nbsp;Hege&amp;nbsp;Refsnes!
My&amp;nbsp;brother&amp;#39;s&amp;nbsp;name&amp;nbsp;is&amp;nbsp;Ståle&amp;nbsp;Refsnes?&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 函数 - 返回值&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;如需让函数返回一个值，请使用 return 语句。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;($&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;,$&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;)
{
 &amp;nbsp; &amp;nbsp;$&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;total&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=$&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;+$&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;total&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;
} 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;1 + 16 = &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;输出：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;1&amp;nbsp;+&amp;nbsp;16&amp;nbsp;=&amp;nbsp;17&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 变量函数&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;变量函数是指在 PHP 中，将一个变量作为函数名来调用的函数。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;变量函数可以让我们在运行时动态地决定调用哪个函数。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;function&lt;/span&gt;&amp;nbsp;foo&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;{&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #770088;&quot;&gt;echo&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;In foo()&amp;lt;br /&amp;gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;}&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;function&lt;/span&gt;&amp;nbsp;bar&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$arg&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;{&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #770088;&quot;&gt;echo&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;In bar(); argument was &amp;#39;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #006699; font-weight: bold;&quot;&gt;$arg&lt;/span&gt;&amp;#39;.&amp;lt;br /&amp;gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;}&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500; font-style: italic;&quot;&gt;// 使用 echo 的包装函数&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;function&lt;/span&gt;&amp;nbsp;echoit&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$string&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;{&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #770088;&quot;&gt;echo&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$string&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;}&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$func&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$func&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500; font-style: italic;&quot;&gt;// 调用 foo()&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$func&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;#39;bar&amp;#39;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$func&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;#39;test&amp;#39;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500; font-style: italic;&quot;&gt;// 调用 bar()&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$func&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;#39;echoit&amp;#39;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$func&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;#39;test&amp;#39;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500; font-style: italic;&quot;&gt;// 调用 echoit()&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;也可以用变量函数的语法来调用一个对象的方法。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;class&lt;/span&gt;&amp;nbsp;Foo&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;{&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;function&lt;/span&gt;&amp;nbsp;Variable&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;{&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;#39;Bar&amp;#39;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500; font-style: italic;&quot;&gt;// 调用 Bar() 方法&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;}&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;function&lt;/span&gt;&amp;nbsp;Bar&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;{&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #770088;&quot;&gt;echo&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;This is Bar&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;}&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;}&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$foo&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Foo&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$funcname&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;Variable&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$foo&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;$funcname&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #116644;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500; font-style: italic;&quot;&gt;// 调用 $foo-&amp;gt;Variable()&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #000000;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:56:35 +0800</pubDate></item><item><title>PHP 超级全局变量</title><link>https://www.th-hy.cn/?id=17</link><description>&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;超级全局变量在PHP 4.1.0之后被启用, 是PHP系统中自带的变量，在一个脚本的全部作用域中都可用。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 超级全局变量&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP中预定义了几个超级全局变量（superglobals） ，这意味着它们在一个脚本的全部作用域中都可用。 你不需要特别说明，就可以在函数及类中使用。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 超级全局变量列表:&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;$GLOBALS&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_SERVER&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_REQUEST&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_POST&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_GET&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_FILES&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_ENV&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_COOKIE&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$_SESSION&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;本章节我们将讲解几个常用的超级全局变量,其余变量我们在接下来几个章节会介绍到。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $GLOBALS&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;$GLOBALS 是PHP的一个超级全局变量组，在一个PHP脚本的全部作用域中都可以访问。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;$GLOBALS 是一个包含了全部变量的全局组合数组。变量的名字就是数组的键。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例介绍了如何使用超级全局变量 $GLOBALS:&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;addition&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; 
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;addition&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_global_global&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以上实例中 z 是一个$GLOBALS数组中的超级全局变量，该变量同样可以在函数外访问。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $_SERVER&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;$_SERVER 是一个包含了诸如头信息(header)、路径(path)、以及脚本位置(script locations)等等信息的数组。这个数组中的项目由 Web 服务器创建。不能保证每个服务器都提供全部项目；服务器可能会忽略一些，或者提供一些没有在这里列举出来的项目。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例中展示了如何使用$_SERVER中的元素:&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;PHP_SELF&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;SERVER_NAME&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;HTTP_HOST&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;HTTP_REFERER&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;HTTP_USER_AGENT&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;SCRIPT_NAME&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_global_server&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;下表列出了所有 $_SERVER 变量中的重要元素:&lt;/p&gt;&lt;table class=&quot;reference&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left; width: 267.578px;&quot;&gt;元素/代码&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left; width: 521.812px;&quot;&gt;描述&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;PHP_SELF&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前执行脚本的文件名，与 document root 有关。例如，在地址为 http://example.com/test.php/foo.bar 的脚本中使用 $_SERVER[&amp;#39;PHP_SELF&amp;#39;] 将得到 /test.php/foo.bar。__FILE__ 常量包含当前(例如包含)文件的完整路径和文件名。 从 PHP 4.3.0 版本开始，如果 PHP 以命令行模式运行，这个变量将包含脚本名。之前的版本该变量不可用。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;GATEWAY_INTERFACE&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;服务器使用的 CGI 规范的版本；例如，&amp;quot;CGI/1.1&amp;quot;。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SERVER_ADDR&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前运行脚本所在的服务器的 IP 地址。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SERVER_NAME&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前运行脚本所在的服务器的主机名。如果脚本运行于虚拟主机中，该名称是由那个虚拟主机所设置的值决定。(如: www.runoob.com)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SERVER_SOFTWARE&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;服务器标识字符串，在响应请求时的头信息中给出。 (如：Apache/2.2.24)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SERVER_PROTOCOL&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;请求页面时通信协议的名称和版本。例如，&amp;quot;HTTP/1.0&amp;quot;。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;REQUEST_METHOD&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;访问页面使用的请求方法；例如，&amp;quot;GET&amp;quot;, &amp;quot;HEAD&amp;quot;，&amp;quot;POST&amp;quot;，&amp;quot;PUT&amp;quot;。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;REQUEST_TIME&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;请求开始时的时间戳。从 PHP 5.1.0 起可用。 (如：1377687496)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;QUERY_STRING&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;query string（查询字符串），如果有的话，通过它进行页面访问。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;HTTP_ACCEPT&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前请求头中 Accept: 项的内容，如果存在的话。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;HTTP_ACCEPT_CHARSET&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前请求头中 Accept-Charset: 项的内容，如果存在的话。例如：&amp;quot;iso-8859-1,*,utf-8&amp;quot;。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;HTTP_HOST&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前请求头中 Host: 项的内容，如果存在的话。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;HTTP_REFERER&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;引导用户代理到当前页的前一页的地址（如果存在）。由 user agent 设置决定。并不是所有的用户代理都会设置该项，有的还提供了修改 HTTP_REFERER 的功能。简言之，该值并不可信。)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;HTTPS&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果脚本是通过 HTTPS 协议被访问，则被设为一个非空的值。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;REMOTE_ADDR&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;浏览当前页面的用户的 IP 地址。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;REMOTE_HOST&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;浏览当前页面的用户的主机名。DNS 反向解析不依赖于用户的 REMOTE_ADDR。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;REMOTE_PORT&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;用户机器上连接到 Web 服务器所使用的端口号。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SCRIPT_FILENAME&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前执行脚本的绝对路径。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SERVER_ADMIN&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;该值指明了 Apache 服务器配置文件中的 SERVER_ADMIN 参数。如果脚本运行在一个虚拟主机上，则该值是那个虚拟主机的值。(如：someone@runoob.com)&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SERVER_PORT&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;Web 服务器使用的端口。默认值为 &amp;quot;80&amp;quot;。如果使用 SSL 安全连接，则这个值为用户设置的 HTTP 端口。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SERVER_SIGNATURE&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;包含了服务器版本和虚拟主机名的字符串。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;PATH_TRANSLATED&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;当前脚本所在文件系统（非文档根目录）的基本路径。这是在服务器进行虚拟到真实路径的映像后的结果。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SCRIPT_NAME&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;包含当前脚本的路径。这在页面需要指向自己时非常有用。__FILE__ 常量包含当前脚本(例如包含文件)的完整路径和文件名。&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;$_SERVER[&amp;#39;SCRIPT_URI&amp;#39;]&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;URI 用来指定要访问的页面。例如 &amp;quot;/index.html&amp;quot;。&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br style=&quot;color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(250, 250, 248);&quot;/&gt;&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $_REQUEST&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $_REQUEST 用于收集HTML表单提交的数据。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例显示了一个输入字段（input）及提交按钮(submit)的表单(form)。 当用户通过点击 &amp;quot;Submit&amp;quot; 按钮提交表单数据时, 表单数据将发送至&amp;lt;form&amp;gt;标签中 action 属性中指定的脚本文件。 在这个实例中，我们指定文件来处理表单数据。如果你希望其他的PHP文件来处理该数据，你可以修改该指定的脚本文件名。 然后，我们可以使用超级全局变量 $_REQUEST 来收集表单中的 input 字段数据:&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;?php echo $_SERVER[&amp;#39;PHP_SELF&amp;#39;];?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Name: &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;_REQUEST&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;[&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&amp;#39;]; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_global_request&quot; target=&quot;_blank&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br style=&quot;color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(250, 250, 248);&quot;/&gt;&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $_POST&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $_POST 被广泛应用于收集表单数据，在HTML form标签的指定该属性：&amp;quot;method=&amp;quot;post&amp;quot;。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例显示了一个输入字段（input）及提交按钮(submit)的表单(form)。 当用户通过点击 &amp;quot;Submit&amp;quot; 按钮提交表单数据时, 表单数据将发送至&amp;lt;form&amp;gt;标签中 action 属性中指定的脚本文件。 在这个实例中，我们指定文件来处理表单数据。如果你希望其他的PHP文件来处理该数据，你可以修改该指定的脚本文件名。 然后，我们可以使用超级全局变量 $_POST 来收集表单中的 input 字段数据:&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;?php echo $_SERVER[&amp;#39;PHP_SELF&amp;#39;];?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;Name: &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;_POST&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;[&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&amp;#39;]; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_global_post&quot; target=&quot;_blank&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br style=&quot;color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(250, 250, 248);&quot;/&gt;&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $_GET&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP $_GET 同样被广泛应用于收集表单数据，在HTML form标签的指定该属性：&amp;quot;method=&amp;quot;get&amp;quot;。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;$_GET 也可以收集URL中发送的数据。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;假定我们有一个包含参数的超链接HTML页面：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;a&amp;nbsp;href=&amp;quot;test_get.php?subject=PHP&amp;amp;web=runoob.com&amp;quot;&amp;gt;Test&amp;nbsp;$GET&amp;lt;/a&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;当用户点击链接 &amp;quot;Test $GET&amp;quot;, 参数 &amp;quot;subject&amp;quot; 和 &amp;quot;web&amp;quot; 将发送至&amp;quot;test_get.php&amp;quot;,你可以在 &amp;quot;test_get.php&amp;quot; 文件中使用 $_GET 变量来获取这些数据。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例显示了 &amp;quot;test_get.php&amp;quot; 文件的代码:&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Study &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;_GET&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;[&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&amp;#39;] . &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt; @ &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . $&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;_GET&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;[&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;web&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&amp;#39;];&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_global_get&quot; target=&quot;_blank&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:56:05 +0800</pubDate></item><item><title>PHP 运算符</title><link>https://www.th-hy.cn/?id=16</link><description>&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;本章节我们将讨论 PHP 中不同运算符的应用。&lt;/p&gt;&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在 PHP 中，赋值运算符&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;=&lt;/span&gt;&amp;nbsp;用于给变量赋值。&lt;/p&gt;&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在 PHP 中，算术运算符&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;+&lt;/span&gt;&amp;nbsp;用于把值加在一起。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 算术运算符&lt;/h2&gt;&lt;table class=&quot;reference&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th width=&quot;13%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;运算符&lt;/th&gt;&lt;th width=&quot;20%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;名称&lt;/th&gt;&lt;th width=&quot;30%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;描述&lt;/th&gt;&lt;th width=&quot;27%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;实例&lt;/th&gt;&lt;th width=&quot;10%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;结果&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x + y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;加&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 和 y 的和&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;2 + 2&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;4&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x - y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;减&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 和 y 的差&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5 - 2&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x * y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;乘&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 和 y 的积&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5 * 2&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;10&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x / y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;除&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 和 y 的商&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;15 / 5&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;3&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x % y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;模（除法的余数）&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 除以 y 的余数&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5 % 2&lt;br/&gt;10 % 8&lt;br/&gt;10 % 2&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;1&lt;br/&gt;2&lt;br/&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;-x&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;设置负数&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;取 x 的相反符号&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;?php
$x&amp;nbsp;=&amp;nbsp;2;
echo&amp;nbsp;-$x;
?&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;-2&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;~x&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;取反&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&lt;p style=&quot;border: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em;&quot;&gt;x 取反，按二进制位进行&amp;quot;取反&amp;quot;运算。运算规则：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;~1=-2;&amp;nbsp;&amp;nbsp;&amp;nbsp;
~0=-1;&lt;/pre&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: initial; overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;&amp;lt;?php
$x&amp;nbsp;=&amp;nbsp;2;
echo&amp;nbsp;~$x;
?&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;-3&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;a . b&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;并置&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;连接两个字符串&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&amp;quot;Hi&amp;quot; . &amp;quot;Ha&amp;quot;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;HiHa&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例演示了使用不同算术运算符得到的不同结果：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出16&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 换行&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; - &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出4&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 换行&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出60&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 换行&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; / &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出1.6666666666667&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 换行&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; % &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出4&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 换行&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_operator_arithmetic&quot; rel=&quot;noopener noreferrer&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;尝试一下 »&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP7+ 版本新增整除运算符&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;intdiv()&lt;/strong&gt;，该函数返回值为第一个参数除于第二个参数的值并取整（向下取整），使用实例：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;intdiv&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以上实例会输出：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;int(3)&lt;/pre&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 赋值运算符&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在 PHP 中，基本的赋值运算符是&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;=&lt;/span&gt;。它意味着左操作数被设置为右侧表达式的值。也就是说，&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;$x = 5&lt;/span&gt;&amp;nbsp;的值是 5。&lt;/p&gt;&lt;table class=&quot;reference&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th width=&quot;13%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;运算符&lt;/th&gt;&lt;th width=&quot;20%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;等同于&lt;/th&gt;&lt;th width=&quot;67%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;描述&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x = y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x = y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;左操作数被设置为右侧表达式的值&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x += y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x = x + y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;加&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x -= y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x = x - y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;减&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x *= y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x = x * y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;乘&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x /= y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x = x / y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;除&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x %= y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x = x % y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;模（除法的余数）&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;a .= b&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;a = a . b&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;连接两个字符串&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例演示了使用不同赋值运算符得到的不同结果：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出10&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; += &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出120&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; -= &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出25&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; *= &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出30&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$j&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$j&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; /= &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$j&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出2&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$k&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$k&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; %= &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$k&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出3&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_operator_assignment&quot; rel=&quot;noopener noreferrer&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;尝试一下 »&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例演示了使用不同字符串运算符得到的相同结果：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; . &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt; world!&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出Hello world! &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; .= &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt; world!&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出Hello world! &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_operator_string&quot; rel=&quot;noopener noreferrer&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;尝试一下 »&lt;/a&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 递增/递减运算符&lt;/h2&gt;&lt;table class=&quot;reference&quot; id=&quot;table1&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th width=&quot;13%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;运算符&lt;/th&gt;&lt;th width=&quot;20%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;名称&lt;/th&gt;&lt;th width=&quot;67%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;描述&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;++ x&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;预递增&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 加 1，然后返回 x&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x ++&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;后递增&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;返回 x，然后 x 加 1&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;-- x&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;预递减&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 减 1，然后返回 x&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x --&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;后递减&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;返回 x，然后 x 减 1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例演示了使用递增/递减运算符得到的结果：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ++&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出11&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;++; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出10&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; --&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出4&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;--; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 输出5&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_operator_increment&quot; rel=&quot;noopener noreferrer&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;尝试一下 »&lt;/a&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 比较运算符&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;比较操作符可以让您比较两个值：&lt;/p&gt;&lt;table class=&quot;reference&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th width=&quot;13%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;运算符&lt;/th&gt;&lt;th width=&quot;20%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;名称&lt;/th&gt;&lt;th width=&quot;37%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;描述&lt;/th&gt;&lt;th width=&quot;30%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;实例&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x == y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;等于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 等于 y，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5==8 返回 false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x === y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;绝对等于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 等于 y，且它们类型相同，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5===&amp;quot;5&amp;quot; 返回 false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x != y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;不等于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 不等于 y，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5!=8 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x &amp;lt;&amp;gt; y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;不等于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 不等于 y，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5&amp;lt;&amp;gt;8 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x !== y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;不绝对等于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 不等于 y，或它们类型不相同，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5!==&amp;quot;5&amp;quot; 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x &amp;gt; y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;大于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 大于 y，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5&amp;gt;8 返回 false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x &amp;lt; y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;小于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 小于 y，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5&amp;lt;8 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x &amp;gt;= y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;大于等于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 大于或者等于 y，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5&amp;gt;=8 返回 false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x &amp;lt;= y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;小于等于&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 小于或者等于 y，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;5&amp;lt;=8 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例演示了使用一些比较运算符得到的不同结果：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; != &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; !== &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_operator_comparison&quot; rel=&quot;noopener noreferrer&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;尝试一下 »&lt;/a&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 逻辑运算符&lt;/h2&gt;&lt;table class=&quot;reference&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th width=&quot;13%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;运算符&lt;/th&gt;&lt;th width=&quot;20%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;名称&lt;/th&gt;&lt;th width=&quot;37%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;描述&lt;/th&gt;&lt;th width=&quot;30%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;实例&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x and y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;与&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 和 y 都为 true，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x=6&lt;br/&gt;y=3&lt;br/&gt;(x &amp;lt; 10 and y &amp;gt; 1) 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x or y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;或&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 和 y 至少有一个为 true，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x=6&lt;br/&gt;y=3&lt;br/&gt;(x==6 or y==5) 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x xor y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;异或&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 和 y 有且仅有一个为 true，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x=6&lt;br/&gt;y=3&lt;br/&gt;(x==6 xor y==3) 返回 false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x &amp;amp;&amp;amp; y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;与&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 和 y 都为 true，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x=6&lt;br/&gt;y=3&lt;br/&gt;(x &amp;lt; 10 &amp;amp;&amp;amp; y &amp;gt; 1) 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x || y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;或&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 和 y 至少有一个为 true，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x=6&lt;br/&gt;y=3&lt;br/&gt;(x==5 || y==5) 返回 false&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;! x&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;非&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 不为 true，则返回 true&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x=6&lt;br/&gt;y=3&lt;br/&gt;!(x==y) 返回 true&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 数组运算符&lt;/h2&gt;&lt;table class=&quot;reference&quot; id=&quot;table2&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th width=&quot;13%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;运算符&lt;/th&gt;&lt;th width=&quot;20%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;名称&lt;/th&gt;&lt;th width=&quot;67%&quot; align=&quot;left&quot; style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;描述&lt;/th&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x + y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;集合&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;x 和 y 的集合&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x == y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;相等&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 和 y 具有相同的键/值对，则返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x === y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;恒等&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 和 y 具有相同的键/值对，且顺序相同类型相同，则返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x != y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;不相等&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 不等于 y，则返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x &amp;lt;&amp;gt; y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;不相等&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 不等于 y，则返回 true&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;x !== y&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;不恒等&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;如果 x 不等于 y，则返回 true&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例演示了使用一些数组运算符得到的不同结果：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;yellow&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; $x 和 $y 数组合并&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; != &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; !== &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$y&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; class=&quot;showbtn&quot; href=&quot;https://www.runoob.com/try/showphp.php?filename=demo_operator_array&quot; rel=&quot;noopener noreferrer&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;尝试一下 »&lt;/a&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;三元运算符&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;另一个条件运算符是&amp;quot;?:&amp;quot;（或三元）运算符 。&lt;/p&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;语法格式&lt;/h3&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;(expr1)&amp;nbsp;?&amp;nbsp;(expr2)&amp;nbsp;:&amp;nbsp;(expr3)&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;对 expr1 求值为 TRUE 时的值为 expr2，在 expr1 求值为 FALSE 时的值为 expr3。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;自 PHP 5.3 起，可以省略三元运算符中间那部分。表达式 expr1 ?: expr3 在 expr1 求值为 TRUE 时返回 expr1，否则返回 expr3。&lt;/p&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;实例&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以下实例中通过判断 $_GET 请求中含有 user 值，如果有返回 $_GET[&amp;#39;user&amp;#39;]，否则返回 nobody：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 普通写法&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ? &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;nobody&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; 
&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; PHP 5.3+ 版本写法&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ?: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;nobody&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;&lt;strong&gt;注意：&lt;/strong&gt;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;PHP_EOL&lt;/span&gt;&amp;nbsp;是一个换行符，兼容更大平台。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;在 PHP7+ 版本多了一个 NULL 合并运算符&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;??&lt;/span&gt;，实例如下：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 如果 $_GET[&amp;#39;user&amp;#39;] 不存在返回 &amp;#39;nobody&amp;#39;，否则返回 $_GET[&amp;#39;user&amp;#39;] 的值&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ?? &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;nobody&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 类似的三元运算符&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; ? &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$_GET&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;nobody&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;组合比较符(PHP7+)&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP7+ 支持组合比较符（combined comparison operator）也称之为太空船操作符，符号为&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;&amp;lt;=&amp;gt;&lt;/span&gt;。组合比较运算符可以轻松实现两个变量的比较，当然不仅限于数值类数据的比较。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;语法格式如下：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;$c&amp;nbsp;=&amp;nbsp;$a&amp;nbsp;&amp;lt;=&amp;gt;&amp;nbsp;$b;&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;解析如下：&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;如果&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;$a &amp;gt; $b&lt;/strong&gt;, 则&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;$c&lt;/strong&gt;&amp;nbsp;的值为&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;1&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;如果&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;$a == $b&lt;/strong&gt;, 则&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;$c&lt;/strong&gt;&amp;nbsp;的值为&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;0&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;如果&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;$a &amp;lt; $b&lt;/strong&gt;, 则&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;$c&lt;/strong&gt;&amp;nbsp;的值为&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;-1&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;实例如下：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 整型&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 0&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; -1&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 浮点型&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;.5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;.5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 0&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;.5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;.5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; -1&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;.5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;.5&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 字符串&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 0&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; -1&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &amp;lt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;运算符优先级&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;下表按照优先级从高到低列出了运算符。同一行中的运算符具有相同优先级，此时它们的结合方向决定求值顺序。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;说明&lt;/strong&gt;：左 ＝ 从左到右，右 ＝ 从右到左。&lt;/p&gt;&lt;table class=&quot;reference&quot; width=&quot;848&quot;&gt;&lt;thead style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot; class=&quot;firstRow&quot;&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;结合方向&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;运算符&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--color-border-dark); margin: 0px; padding: 10px 14px; font-size: 14px; color: rgb(255, 255, 255); background-color: rgb(59, 58, 56); vertical-align: top; text-align: left;&quot;&gt;附加信息&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody class=&quot;tbody&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;无&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;clone new&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;clone 和 new&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;[&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&lt;span class=&quot;function&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;array()&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;右&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;++ -- ~ (int) (float) (string) (array) (object) (bool) @&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;类型和递增／递减&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;无&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;instanceof&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;类型&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;右&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;!&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;逻辑运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;* / %&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;算术运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;+ – .&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;算术运算符和字符串运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&amp;lt;&amp;lt; &amp;gt;&amp;gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;位运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;无&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;== != === !== &amp;lt;&amp;gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;比较运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&amp;amp;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;位运算符和引用&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;^&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;位运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;|&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;位运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;&amp;amp;&amp;amp;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;逻辑运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;||&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;逻辑运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;? :&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;三元运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;右&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;= += -= *= /= .= %= &amp;amp;= |= ^= &amp;lt;&amp;lt;= &amp;gt;&amp;gt;= =&amp;gt;&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;赋值运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;and&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;逻辑运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;xor&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;逻辑运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: var(--color-bg-white);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;or&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;逻辑运算符&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px; background-color: rgb(240, 240, 240);&quot;&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; min-width: 24px; line-height: 2em; vertical-align: top;&quot;&gt;左&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;,&lt;/td&gt;&lt;td style=&quot;border-color: rgb(232, 234, 246); margin: 0px; padding-right: 5px; padding-bottom: 7px; padding-left: 5px; font-size: 14px; line-height: 2em; min-width: 24px; vertical-align: top;&quot;&gt;多处用到&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;运算符优先级中，or 和 ||，&amp;amp;&amp;amp; 和 and 都是逻辑运算符，效果一样，但是其优先级却不一样。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 优先级： &amp;amp;&amp;amp; &amp;nbsp;&amp;gt; &amp;nbsp;= &amp;nbsp;&amp;gt; &amp;nbsp;and&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 优先级： || &amp;nbsp;&amp;gt; &amp;nbsp;= &amp;nbsp;&amp;gt; &amp;nbsp;or&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;or&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 这里的 $c 为 int 值3，而不是 boolean 值 true&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; || &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;这里的 $d 就是 boolean 值 true &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以上实例输出结果为：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;int(3)
bool(true)&lt;/pre&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;括号的使用&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;我们通过括号的配对来明确标明运算顺序，而非靠运算符优先级和结合性来决定，通常能够增加代码的可读性。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 括号优先运算&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-special&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: navy;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$e&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; + &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 使用括号&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-var&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #00008B;&quot;&gt;$e&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-special&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: navy;&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以上实例输出结果为：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;7
9&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:55:33 +0800</pubDate></item><item><title>PHP 字符串变量</title><link>https://www.th-hy.cn/?id=15</link><description>&lt;div class=&quot;article-body&quot; style=&quot;border: 0px; margin: 0px; padding: 10px 10px 20px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;div class=&quot;article-intro&quot; id=&quot;content&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;h1 style=&quot;border: 0px; margin: 0px 0px 10px; padding: 0px; font-size: 2.1em; text-indent: initial;&quot;&gt;PHP&amp;nbsp;&lt;span class=&quot;color_h1&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: var(--color-primary-dark);&quot;&gt;字符串变量&lt;/span&gt;&lt;/h1&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;p class=&quot;intro&quot; style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;字符串变量用于存储并处理文本。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP 中的字符串变量&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;字符串变量用于包含有字符的值。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;在创建字符串之后，我们就可以对它进行操作了。您可以直接在函数中使用字符串，或者把它存储在变量中。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;在下面的实例中，我们创建一个名为 txt 的字符串变量，并赋值为 &amp;quot;Hello world!&amp;quot; 。然后我们输出 txt 变量的值：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;&amp;lt;?php&lt;br/&gt;$txt&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #DD0000;&quot;&gt;&amp;quot;Hello world!&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;;&lt;br/&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;$txt&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;;&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; href=&quot;https://www.runoob.com/try/runcode.php?filename=demo_string_echo&amp;type=php&quot; class=&quot;showbtn&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;br/&gt;&lt;table class=&quot;lamp&quot; width=&quot;848&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;tr style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;th width=&quot;34&quot; style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 10px; padding-right: 5px; padding-bottom: 10px; font-size: 14px; color: rgb(0, 0, 0); background-color: var(--color-bg-white);&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/images/lamp.jpg&quot; width=&quot;32&quot; height=&quot;32&quot; alt=&quot;lamp&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: auto;&quot;/&gt;&lt;/th&gt;&lt;td style=&quot;border-width: 0px; border-style: initial; border-color: initial; margin: 0px; padding-top: 4px; padding-bottom: 4px; padding-left: 0px; font-size: 14px;&quot;&gt;&lt;strong&gt;注释：&lt;/strong&gt;当您赋一个文本值给变量时，请记得给文本值加上单引号或者双引号。&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;现在，让我们来看看一些常用的操作字符串的函数和运算符。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP 并置运算符&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;在 PHP 中，只有一个字符串运算符。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;并置运算符&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;.&lt;/span&gt;&amp;nbsp;用于把两个字符串值连接起来。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;下面的实例演示了如何将两个字符串变量连接在一起：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;&amp;lt;?php&lt;br/&gt;$txt1&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #DD0000;&quot;&gt;&amp;quot;Hello world!&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;;&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;$txt2&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #DD0000;&quot;&gt;&amp;quot;What a nice day!&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;;&lt;br/&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;$txt1&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #DD0000;&quot;&gt;&amp;quot; &amp;quot;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;$txt2&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;;&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;上面的代码将输出：Hello world! What a nice day!&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;提示：&lt;/strong&gt;在上面的代码中，我们已经使用了两次并置运算符。这是由于我们需要在两个字符串之间插入一个空格。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP strlen() 函数&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;有时知道字符串值的长度是很有用的。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;strlen() 函数返回字符串的长度（字节数）。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;下面的实例返回字符串 &amp;quot;Hello world!&amp;quot; 的长度：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;&amp;lt;?php&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;strlen&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #DD0000;&quot;&gt;&amp;quot;Hello world!&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;);&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; href=&quot;https://www.runoob.com/try/runcode.php?filename=demo_string_length&amp;type=php&quot; class=&quot;showbtn&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;上面的代码将输出：12&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;提示：&lt;/strong&gt;strlen() 常常用在循环和其他函数中，因为那时确定字符串何时结束是很重要的。（例如，在循环中，我们需要在字符串中的最后一个字符之后结束循环。）&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;PHP strpos() 函数&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;strpos() 函数用于在字符串内查找一个字符或一段指定的文本。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;如果在字符串中找到匹配，该函数会返回第一个匹配的字符位置。如果未找到匹配，则返回 FALSE。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;下面的实例在字符串 &amp;quot;Hello world!&amp;quot; 中查找文本 &amp;quot;world&amp;quot;：&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background-image: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%); background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; position: relative;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16);&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;&amp;lt;?php&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;strpos&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #DD0000;&quot;&gt;&amp;quot;Hello world!&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #DD0000;&quot;&gt;&amp;quot;world&amp;quot;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #007700;&quot;&gt;);&lt;br/&gt;&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000BB;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&lt;a target=&quot;_blank&quot; href=&quot;https://www.runoob.com/try/runcode.php?filename=demo_string_pos&amp;type=php&quot; class=&quot;showbtn&quot; style=&quot;border: 0px; margin: 0px 0px 5px 5px; padding: 4px 10px; color: rgb(255, 255, 255); text-decoration-line: none; transition: opacity var(--transition-base); display: inline-block; background-color: rgb(140, 168, 109); font-weight: bold; font-size: 14px; text-align: center; border-radius: 2px; white-space: nowrap; outline: none;&quot;&gt;运行实例 »&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;上面的代码将输出：6&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;提示：&lt;/strong&gt;在上面的实例中，字符串 &amp;quot;world&amp;quot; 的位置是 6。之所以是 6 而不是 7 的原因是，字符串中第一个字符的位置是 0，而不是 1。&lt;/p&gt;&lt;hr style=&quot;background-color: rgb(212, 212, 212); color: rgb(212, 212, 212); height: 1px; border: 0px; clear: both;&quot;/&gt;&lt;h2 style=&quot;border: 0px; margin: 2px 0px; padding: 0px; font-size: 1.8em; line-height: 1.8em;&quot;&gt;完整的 PHP String 参考手册&lt;/h2&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;如需查看所有字符串函数的完整参考手册，请访问我们的&amp;nbsp;&lt;a href=&quot;https://www.runoob.com/php/php-ref-string.html&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: rgb(0, 102, 0); transition: opacity var(--transition-base); outline: none;&quot;&gt;PHP String 参考手册&lt;/a&gt;。&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: var(--font-body); word-break: break-word; overflow-wrap: break-word; font-size: 14px; letter-spacing: 0.02em;&quot;&gt;该参考手册提供了每个函数的简要描述和应用实例！&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;previous-next-links&quot; style=&quot;border: 1px solid rgb(231, 234, 241); margin: 0px; padding: 10px 30px; line-height: 24px; overflow: hidden; background: rgb(251, 251, 251); color: rgb(133, 144, 166); font-size: 15px; box-shadow: rgba(0, 37, 55, 0.05) 0px 1px 3px; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal;&quot;&gt;&lt;div class=&quot;previous-design-link&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; float: left;&quot;&gt;&lt;a href=&quot;https://www.runoob.com/php/php-constants.html&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: grey; text-decoration-line: none; transition: opacity var(--transition-base);&quot;&gt;&lt;span class=&quot;fa fa-arrow-left&quot; aria-hidden=&quot;true&quot; style=&quot;display: inline-block; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 16px; line-height: 1; font-family: FontAwesome; text-rendering: auto; -webkit-font-smoothing: antialiased;&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:55:12 +0800</pubDate></item><item><title>PHP 类型比较</title><link>https://www.th-hy.cn/?id=14</link><description>&lt;h1 style=&quot;border: 0px; margin: 0px 0px 10px; padding: 0px; font-size: 2.1em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP 类型比较&lt;/h1&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;虽然 PHP 是弱类型语言，但也需要明白变量类型及它们的意义，因为我们经常需要对 PHP 变量进行比较，包含松散和严格比较。&lt;/p&gt;&lt;ul style=&quot;list-style-type: none;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;松散比较：使用两个等号&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;==&lt;/span&gt;&amp;nbsp;比较，只比较值，不比较类型。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;严格比较：用三个等号&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;===&lt;/span&gt;&amp;nbsp;比较，除了比较值，也比较类型。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;例如，&amp;quot;42&amp;quot; 是一个字符串而 42 是一个整数。&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;FALSE&lt;/span&gt;&amp;nbsp;是一个布尔值而&amp;nbsp;&lt;span class=&quot;marked&quot; style=&quot;border: 0px; margin: 0px; padding: 0.2em; background-color: #ECEAE6; border-radius: var(--radius-sm); font-weight: bold; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace;&quot;&gt;&amp;quot;FALSE&amp;quot;&lt;/span&gt;&amp;nbsp;是一个字符串。&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;1、值相等&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt; 换行符&lt;/span&gt;&lt;span class=&quot;hl-comment&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA5500;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;2、类型相等&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;
 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;3、类型不相等&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以上实例输出结果为：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;1、值相等
3、类型不相等&lt;/pre&gt;&lt;h3 style=&quot;border: 0px; margin: 8px 0px; padding: 0px; font-size: 1.4em; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;PHP中 比较 0、false、null&lt;/h3&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;测试代码:&lt;/p&gt;&lt;div class=&quot;example&quot; style=&quot;border: 1px solid rgba(110, 130, 90, 0.25); margin: 10px 0px; padding: 12px; width: 814.453px; border-radius: var(--radius-base); background: linear-gradient(135deg, rgb(230, 237, 220) 0%, rgb(219, 230, 204) 40%, rgb(207, 220, 188) 100%) rgb(250, 250, 248); position: relative; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; font-size: 12px; white-space: normal;&quot;&gt;&lt;h2 class=&quot;example&quot; style=&quot;border: 0px; margin: 0px 0px 2px; padding: 0px; font-size: 14.4px; line-height: 1.8em; color: rgb(97, 127, 16); background-color: transparent;&quot;&gt;实例&lt;/h2&gt;&lt;div class=&quot;example_code&quot; style=&quot;border: 1px solid rgba(0, 0, 0, 0.06); margin: 8px 0px 0px; padding: 6px 8px; position: relative; background-color: rgb(248, 251, 245); box-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px inset; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); word-break: normal; overflow-x: auto;&quot;&gt;&lt;div class=&quot;hl-main&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; position: relative; min-height: 30px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: break-word;&quot;&gt;&lt;span class=&quot;hl-inlinetags&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0000FF;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0 == false: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0 === false: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0 == null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0 === null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: maroon;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;false == null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;false === null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;0&amp;quot; == false: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;0&amp;quot; === false: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;0&amp;quot; == null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;0&amp;quot; === null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;&amp;quot; == false: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;&amp;quot; === false: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;PHP_EOL&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;&amp;quot; == null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-string&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #AA1111;&quot;&gt;&amp;quot;&amp;quot; === null: &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #0055AA;&quot;&gt;var_dump&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: #8B0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt; === &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: green;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: olive;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; color: gray;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;以上实例输出结果为：&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-width: 1px 1px 1px 4px; border-style: solid; border-color: rgb(221, 221, 221); border-image: initial; margin-top: 12px; margin-bottom: 12px; padding: 14px 16px; position: relative; font-size: 13px; line-height: 1.6; font-family: var(--font-mono); background-image: linear-gradient(145deg, rgb(247, 244, 238), rgb(242, 239, 233)); background-color: rgb(250, 250, 248); overflow: auto; box-shadow: rgba(255, 255, 255, 0.6) 0px 1px 0px inset; color: rgb(43, 43, 43); word-break: break-word !important; overflow-wrap: normal !important; white-space: pre-wrap !important;&quot;&gt;0&amp;nbsp;==&amp;nbsp;false:&amp;nbsp;bool(true)
0&amp;nbsp;===&amp;nbsp;false:&amp;nbsp;bool(false)

0&amp;nbsp;==&amp;nbsp;null:&amp;nbsp;bool(true)
0&amp;nbsp;===&amp;nbsp;null:&amp;nbsp;bool(false)

false&amp;nbsp;==&amp;nbsp;null:&amp;nbsp;bool(true)
false&amp;nbsp;===&amp;nbsp;null:&amp;nbsp;bool(false)

&amp;quot;0&amp;quot;&amp;nbsp;==&amp;nbsp;false:&amp;nbsp;bool(true)
&amp;quot;0&amp;quot;&amp;nbsp;===&amp;nbsp;false:&amp;nbsp;bool(false)

&amp;quot;0&amp;quot;&amp;nbsp;==&amp;nbsp;null:&amp;nbsp;bool(false)
&amp;quot;0&amp;quot;&amp;nbsp;===&amp;nbsp;null:&amp;nbsp;bool(false)

&amp;quot;&amp;quot;&amp;nbsp;==&amp;nbsp;false:&amp;nbsp;bool(true)
&amp;quot;&amp;quot;&amp;nbsp;===&amp;nbsp;false:&amp;nbsp;bool(false)

&amp;quot;&amp;quot;&amp;nbsp;==&amp;nbsp;null:&amp;nbsp;bool(true)
&amp;quot;&amp;quot;&amp;nbsp;===&amp;nbsp;null:&amp;nbsp;bool(false)&lt;/pre&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/wp-content/uploads/2019/05/1791863413-572055b100304_articlex.png&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: auto;&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;border: 0px; margin-top: 0px; margin-bottom: 0px; padding: 0px; line-height: 1.9; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, Arial, sans-serif; word-break: break-word; overflow-wrap: break-word; letter-spacing: 0.02em; color: rgb(51, 51, 51); white-space: normal; background-color: rgb(250, 250, 248);&quot;&gt;&lt;img decoding=&quot;async&quot; src=&quot;https://www.runoob.com/wp-content/uploads/2019/05/xxxxphp.png&quot; style=&quot;border: 0px; margin: 0px; padding: 0px; max-width: 100%; height: auto;&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 02 Jun 2026 07:54:37 +0800</pubDate></item></channel></rss>