{"id":74246,"date":"2026-02-09T14:05:41","date_gmt":"2026-02-09T06:05:41","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/74246.html"},"modified":"2026-02-09T14:05:41","modified_gmt":"2026-02-09T06:05:41","slug":"web%e5%ae%89%e5%85%a8%e5%9f%ba%e7%a1%80%e7%9b%b8%e5%85%b3%e7%9f%a5%e8%af%863-0%ef%bc%88%e5%90%8e%e7%ab%af%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/74246.html","title":{"rendered":"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09"},"content":{"rendered":"<h2>PHP\u8bed\u8a00<\/h2>\n<p>PHP&#xff08;\u5168\u79f0&#xff1a;PHP: Hypertext Preprocessor&#xff0c;\u5373\u201c\u8d85\u6587\u672c\u9884\u5904\u7406\u5668\u201d&#xff09;\u662f\u4e00\u79cd\u5f00\u6e90\u3001\u901a\u7528\u7684\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00&#xff0c;\u5c24\u5176\u9002\u5408 Web \u5f00\u53d1\u3002\u5b83\u53ef\u5d4c\u5165 HTML&#xff0c;\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u5e76\u751f\u6210\u52a8\u6001\u5185\u5bb9&#xff08;\u5982\u7f51\u9875\u3001\u63a5\u53e3&#xff09;&#xff0c;\u518d\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\u3002<\/p>\n<h3>\u53d1\u5c55\u5386\u53f2<\/h3>\n<p>* 1994\u5e74&#xff1a;Rasmus Lerdorf \u4e3a\u7ba1\u7406\u4e2a\u4eba\u4e3b\u9875\u521b\u5efa\u4e86 PHP \u96cf\u5f62\u3002<br \/>\n* 1995\u5e74&#xff1a;\u53d1\u5e03 PHP\/FI (Personal Home Page \/ Forms Interpreter)&#xff0c;\u6807\u5fd7\u7740 PHP \u7684\u8bde\u751f\u3002<br \/>\n* 1998\u5e74&#xff1a;PHP 3 \u53d1\u5e03&#xff0c;\u91cd\u5199\u4e86\u89e3\u6790\u5668\u5e76\u6b63\u5f0f\u66f4\u540d\u4e3a PHP&#xff0c;\u5f00\u59cb\u652f\u6301\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002<br \/>\n* 2000\u5e74&#xff1a;PHP 4 \u57fa\u4e8e Zend Engine 1.0&#xff0c;\u6027\u80fd\u548c\u6269\u5c55\u6027\u5927\u5e45\u63d0\u5347\u3002<br \/>\n* 2004\u5e74&#xff1a;PHP 5 \u5f15\u5165 Zend Engine 2.0&#xff0c;\u5168\u9762\u652f\u6301\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b&#xff08;OOP&#xff09;\u3002<br \/>\n* 2015\u5e74&#xff1a;PHP 7 \u53d1\u5e03&#xff0c;\u6027\u80fd\u7ffb\u500d&#xff0c;\u5e76\u5f15\u5165\u6807\u91cf\u7c7b\u578b\u58f0\u660e\u3001\u8fd4\u56de\u7c7b\u578b\u58f0\u660e\u7b49\u65b0\u7279\u6027\u3002<br \/>\n* 2020\u5e74\u81f3\u4eca&#xff1a;PHP 8 \u5f15\u5165 JIT&#xff08;\u5373\u65f6\u7f16\u8bd1&#xff09;\u548c\u8054\u5408\u7c7b\u578b\u3001\u5c5e\u6027\u3001match \u8868\u8fbe\u5f0f\u7b49\u73b0\u4ee3\u8bed\u8a00\u7279\u6027&#xff0c;\u6301\u7eed\u63d0\u5347\u6027\u80fd\u4e0e\u5f00\u53d1\u4f53\u9a8c\u3002<\/p>\n<h3>\u6838\u5fc3\u7279\u70b9<\/h3>\n<p>* \u5f00\u6e90\u514d\u8d39&#xff1a;\u53ef\u81ea\u7531\u4f7f\u7528\u3001\u4fee\u6539\u548c\u5206\u53d1&#xff0c;\u793e\u533a\u6d3b\u8dc3&#xff0c;\u751f\u6001\u4e30\u5bcc\u3002<br \/>\n* \u670d\u52a1\u5668\u7aef\u6267\u884c&#xff1a;\u4ee3\u7801\u5728\u670d\u52a1\u5668\u8fd0\u884c&#xff0c;\u751f\u6210 HTML \u53d1\u9001\u7ed9\u5ba2\u6237\u7aef&#xff0c;\u4fdd\u969c\u6e90\u7801\u5b89\u5168\u3002<br \/>\n* \u6613\u4e8e\u5d4c\u5165 HTML&#xff1a;\u53ef\u5728\u00a0<br \/>\n&#034;.php&#034; \u6587\u4ef6\u4e2d\u6df7\u5408\u7f16\u5199 HTML\u3001CSS\u3001JavaScript \u548c PHP \u4ee3\u7801\u3002<br \/>\n* \u8de8\u5e73\u53f0&#xff1a;\u652f\u6301 Windows\u3001Linux\u3001macOS \u7b49\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\u3002<br \/>\n* \u6570\u636e\u5e93\u96c6\u6210\u80fd\u529b\u5f3a&#xff1a;\u539f\u751f\u652f\u6301 MySQL\u3001PostgreSQL\u3001SQLite \u7b49&#xff0c;\u5e76\u63d0\u4f9b PDO \u7b49\u901a\u7528\u63a5\u53e3\u3002<br \/>\n* \u8bed\u6cd5\u7b80\u5355&#xff1a;\u8bed\u6cd5\u63a5\u8fd1 C\/Perl&#xff0c;\u5bf9\u521d\u5b66\u8005\u53cb\u597d&#xff0c;\u5f00\u53d1\u6548\u7387\u9ad8\u3002<br \/>\n* \u652f\u6301\u591a\u79cd\u534f\u8bae&#xff1a;\u9664 HTTP\/HTTPS \u5916&#xff0c;\u8fd8\u652f\u6301 FTP\u3001IMAP\u3001POP3\u3001SMTP \u7b49\u3002<br \/>\n* \u6269\u5c55\u6027\u5f3a&#xff1a;\u62e5\u6709\u5927\u91cf\u5185\u7f6e\u51fd\u6570\u548c\u6269\u5c55&#xff08;\u5982 GD\u3001cURL&#xff09;&#xff0c;\u4e5f\u652f\u6301\u7528 C \u8bed\u8a00\u7f16\u5199\u81ea\u5b9a\u4e49\u6269\u5c55\u3002<\/p>\n<h3>\u4e3b\u8981\u5e94\u7528\u573a\u666f<\/h3>\n<p>* \u52a8\u6001\u7f51\u7ad9\u4e0e\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf (CMS)&#xff1a;\u5982 WordPress\u3001Drupal\u3001\u7ec7\u68a6\u7b49\u3002<br \/>\n* \u7535\u5b50\u5546\u52a1\u5e73\u53f0&#xff1a;\u5404\u7c7b\u5728\u7ebf\u5546\u57ce\u3001\u8ba2\u5355\u7cfb\u7edf\u3002<br \/>\n* \u793e\u4ea4\u7f51\u7edc\u4e0e\u793e\u533a\u8bba\u575b&#xff1a;\u5982\u65e9\u671f\u7684 Facebook\u3001\u5404\u7c7b BBS\u3002<br \/>\n* Web \u5e94\u7528\u4e0e API \u63a5\u53e3&#xff1a;\u5f00\u53d1\u540e\u7aef\u670d\u52a1\u3001RESTful API\u3001\u5fae\u670d\u52a1\u3002<br \/>\n* \u547d\u4ee4\u884c\u811a\u672c&#xff1a;\u7528\u4e8e\u5b9a\u65f6\u4efb\u52a1\u3001\u6279\u91cf\u6570\u636e\u5904\u7406\u7b49\u3002<br \/>\n* \u56fe\u50cf\u5904\u7406\u4e0e\u6587\u4ef6\u64cd\u4f5c&#xff1a;\u751f\u6210\u9a8c\u8bc1\u7801\u3001\u7f29\u7565\u56fe&#xff0c;\u5904\u7406\u6587\u4ef6\u4e0a\u4f20\u4e0b\u8f7d\u3002<\/p>\n<h3>\u57fa\u672c\u8bed\u6cd5\u793a\u4f8b<\/h3>\n<p>PHP \u6587\u4ef6\u901a\u5e38\u4ee5\u00a0<br \/>\n&#034;.php&#034; \u4e3a\u6269\u5c55\u540d&#xff0c;\u53ef\u5305\u542b HTML \u548c PHP \u4ee3\u7801\u3002<\/p>\n<h4>1. Hello World<\/h4>\n<p>php<\/p>\n<p>&lt;?php<\/p>\n<p>echo &#034;Hello, World!&#034;;<\/p>\n<p>?&gt;<\/p>\n<p>\u8bf4\u660e&#xff1a;<br \/>\n&#034;&lt;?php &#8230; ?&gt;&#034; \u662f PHP \u4ee3\u7801\u5757\u6807\u7b7e\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;echo&#034; \u7528\u4e8e\u8f93\u51fa\u5185\u5bb9\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u8bed\u53e5\u4ee5\u5206\u53f7\u00a0 \u00a0 &#034;;&#034; \u7ed3\u5c3e<\/p>\n<h4>\n2. \u53d8\u91cf\u4e0e\u6570\u636e\u7c7b\u578b<\/h4>\n<p>PHP \u662f\u5f31\u7c7b\u578b\u8bed\u8a00&#xff0c;\u53d8\u91cf\u4ee5\u00a0&#034;$&#034; \u5f00\u5934&#xff0c;\u65e0\u9700\u9884\u5148\u58f0\u660e\u7c7b\u578b\u3002<\/p>\n<p>php<\/p>\n<p>&lt;?php<\/p>\n<p>$name &#061; &#034;Alice&#034;; \u00a0 \u00a0 \/\/ \u5b57\u7b26\u4e32<\/p>\n<p>$age &#061; 25; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u6574\u6570<\/p>\n<p>$price &#061; 9.99; \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u6d6e\u70b9\u6570<\/p>\n<p>$isStudent &#061; true; \u00a0 \u00a0\/\/ \u5e03\u5c14\u503c<\/p>\n<p>$colors &#061; [&#034;red&#034;, &#034;green&#034;, &#034;blue&#034;]; \/\/ \u6570\u7ec4<\/p>\n<p>echo &#034; name is \u00a0age years old.&#034;;<\/p>\n<p>?&gt;<\/p>\n<h4>3. \u63a7\u5236\u7ed3\u6784<\/h4>\n<p>\u652f\u6301\u5e38\u89c1\u7684\u00a0&#034;if\/else&#034;\u3001&#034;switch&#034;\u3001&#034;for&#034;\u3001&#034;while&#034;\u3001&#034;foreach&#034; \u7b49\u6d41\u7a0b\u63a7\u5236\u8bed\u53e5\u3002<\/p>\n<p>php<\/p>\n<p>&lt;?php<\/p>\n<p>$score &#061; 85;<\/p>\n<p>if ($score &gt;&#061; 90) {<\/p>\n<p>echo &#034;\u4f18\u79c0&#034;;<\/p>\n<p>} elseif ($score &gt;&#061; 70) {<\/p>\n<p>echo &#034;\u826f\u597d&#034;;<\/p>\n<p>} else {<\/p>\n<p>echo &#034;\u4e00\u822c&#034;;<\/p>\n<p>}<\/p>\n<p>for ( i &#061; 1; \u00a0i &lt;&#061; 5; $i&#043;&#043;) {<\/p>\n<p>echo $i . &#034; &#034;;<\/p>\n<p>}<\/p>\n<p>?&gt;<\/p>\n<h4>4. \u51fd\u6570<\/h4>\n<p>\u4f7f\u7528\u00a0<br \/>\n&#034;function&#034; \u5173\u952e\u5b57\u5b9a\u4e49\u53ef\u590d\u7528\u7684\u4ee3\u7801\u5757\u3002<\/p>\n<p>php<\/p>\n<p>&lt;?php<\/p>\n<p>function greet($name) {<\/p>\n<p>return &#034;Hello, &#034; . $name . &#034;!&#034;;<\/p>\n<p>}<\/p>\n<p>echo greet(&#034;Bob&#034;);<\/p>\n<p>?&gt;<\/p>\n<h4>5. \u8868\u5355\u5904\u7406<\/h4>\n<p>\u901a\u8fc7\u8d85\u5168\u5c40\u6570\u7ec4\u00a0<br \/>\n&#034;$_GET&#034; \u548c\u00a0<br \/>\n&#034;$_POST&#034; \u83b7\u53d6\u7528\u6237\u63d0\u4ea4\u7684\u6570\u636e\u3002<\/p>\n<p>php<\/p>\n<p>&lt;!&#8211; form.html &#8211;&gt;<\/p>\n<p>&lt;form method&#061;&#034;post&#034; action&#061;&#034;process.php&#034;&gt;<\/p>\n<p>&lt;input type&#061;&#034;text&#034; name&#061;&#034;username&#034;&gt;<\/p>\n<p>&lt;button type&#061;&#034;submit&#034;&gt;\u63d0\u4ea4&lt;\/button&gt;<\/p>\n<p>&lt;\/form&gt;<\/p>\n<p>&lt;!&#8211; process.php &#8211;&gt;<\/p>\n<p>&lt;?php<\/p>\n<p>if ($_SERVER[&#034;REQUEST_METHOD&#034;] &#061;&#061; &#034;POST&#034;) {<\/p>\n<p>\u00a0username &#061; htmlspecialchars( _POST[&#039;username&#039;]); \/\/ \u7b80\u5355\u8fc7\u6ee4<\/p>\n<p>echo &#034;Welcome, &#034; . $username;<\/p>\n<p>}<\/p>\n<p>?&gt;<\/p>\n<h4>6. \u6570\u636e\u5e93\u64cd\u4f5c\u00a0<\/h4>\n<p>\u4f7f\u7528 MySQLi \u6269\u5c55\u8fde\u63a5\u5e76\u64cd\u4f5c MySQL \u6570\u636e\u5e93\u3002<\/p>\n<p>php<\/p>\n<p>&lt;?php<\/p>\n<p>$conn &#061; new mysqli(&#034;localhost&#034;, &#034;root&#034;, &#034;password&#034;, &#034;test_db&#034;);<\/p>\n<p>if ($conn-&gt;connect_error) {<\/p>\n<p>die(&#034;\u8fde\u63a5\u5931\u8d25: &#034; . $conn-&gt;connect_error);<\/p>\n<p>}<\/p>\n<p>$sql &#061; &#034;SELECT id, name FROM users&#034;;<\/p>\n<p>\u00a0result &#061; \u00a0conn-&gt;query($sql);<\/p>\n<p>if ($result-&gt;num_rows &gt; 0) {<\/p>\n<p>while( row &#061; \u00a0result-&gt;fetch_assoc()) {<\/p>\n<p>echo &#034;ID: &#034; . \u00a0row[&#034;id&#034;]. &#034; &#8211; Name: &#034; . \u00a0row[&#034;name&#034;]. &#034;&lt;br&gt;&#034;;<\/p>\n<p>}<\/p>\n<p>} else {<\/p>\n<p>echo &#034;0 \u7ed3\u679c&#034;;<\/p>\n<p>}<\/p>\n<p>$conn-&gt;close();<\/p>\n<p>?&gt;<\/p>\n<h3>\u8fd0\u884c\u673a\u5236<\/h3>\n<p>1. \u7528\u6237\u8bf7\u6c42&#xff1a;\u6d4f\u89c8\u5668\u5411\u670d\u52a1\u5668\u8bf7\u6c42\u4e00\u4e2a\u00a0<br \/>\n&#034;.php&#034; \u9875\u9762\u3002<br \/>\n2. \u670d\u52a1\u5668\u89e3\u6790&#xff1a;Web \u670d\u52a1\u5668&#xff08;\u5982 Apache\/Nginx&#xff09;\u5c06\u8bf7\u6c42\u4ea4\u7ed9 PHP \u5f15\u64ce\u5904\u7406\u3002<br \/>\n3. \u4ee3\u7801\u6267\u884c&#xff1a;PHP \u5f15\u64ce\u6267\u884c\u811a\u672c&#xff0c;\u53ef\u80fd\u8fde\u63a5\u6570\u636e\u5e93\u3001\u5904\u7406\u4e1a\u52a1\u903b\u8f91\u7b49\u3002<br \/>\n4. \u751f\u6210\u7ed3\u679c&#xff1a;\u811a\u672c\u6267\u884c\u5b8c\u6bd5\u540e&#xff0c;\u751f\u6210\u7eaf HTML \u5185\u5bb9\u3002<br \/>\n5. \u8fd4\u56de\u54cd\u5e94&#xff1a;Web \u670d\u52a1\u5668\u5c06\u751f\u6210\u7684 HTML \u53d1\u9001\u56de\u7528\u6237\u7684\u6d4f\u89c8\u5668\u8fdb\u884c\u6e32\u67d3\u3002<\/p>\n<p>\u6838\u5fc3\u7ec4\u4ef6<\/p>\n<p>* Zend \u5f15\u64ce&#xff1a;PHP \u7684\u6838\u5fc3&#xff0c;\u8d1f\u8d23\u5c06 PHP \u4ee3\u7801\u7f16\u8bd1\u4e3a opcode \u5e76\u6267\u884c\u3002<br \/>\n* OPcache&#xff1a;\u7f13\u5b58 opcode&#xff0c;\u907f\u514d\u91cd\u590d\u7f16\u8bd1&#xff0c;\u663e\u8457\u63d0\u5347\u6027\u80fd\u3002<br \/>\n* PHP-FPM&#xff1a;\u4e00\u4e2a\u9ad8\u6548\u7684 FastCGI \u8fdb\u7a0b\u7ba1\u7406\u5668&#xff0c;\u7528\u4e8e\u5904\u7406\u5e76\u53d1\u8bf7\u6c42\u3002<\/p>\n<h2>\nGET\u4e0ePOST<\/h2>\n<p>\u9996\u5148&#xff0c;\u4e00\u4e2a\u6700\u5f62\u8c61\u7684\u6bd4\u55bb&#xff1a;<\/p>\n<p>* GET \u5c31\u50cf\u662f\u5728\u56fe\u4e66\u9986\u67e5\u4e66\u76ee\u5f55\u3002\u4f60\u53ea\u662f\u53bb\u83b7\u53d6\u4fe1\u606f&#xff0c;\u8fd9\u4e2a\u884c\u4e3a\u672c\u8eab\u4e0d\u4f1a\u6539\u53d8\u4efb\u4f55\u4e1c\u897f\u3002<br \/>\n* POST \u5c31\u50cf\u662f\u5411\u56fe\u4e66\u9986\u63d0\u4ea4\u4e00\u4efd\u65b0\u4e66\u7533\u8bf7\u6216\u501f\u4e66\u5355\u3002\u4f60\u901a\u8fc7\u5b83\u6765\u5411\u7cfb\u7edf\u63d0\u4ea4\u6570\u636e&#xff0c;\u5e76\u5e0c\u671b\u7cfb\u7edf\u80fd\u6839\u636e\u8fd9\u4e9b\u6570\u636e\u505a\u51fa\u4e00\u4e9b\u6539\u53d8\u6216\u5904\u7406\u3002<\/p>\n<h3>\u6838\u5fc3\u533a\u522b\u5bf9\u6bd4\u8868<\/h3>\n<p>\u7279\u5f81\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0GET\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0POST<br \/>\n\u4e3b\u8981\u7528\u9014\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4ece\u670d\u52a1\u5668\u83b7\u53d6&#xff08;\u67e5\u8be2&#xff09;\u6570\u636e\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5411\u670d\u52a1\u5668\u63d0\u4ea4&#xff08;\u521b\u5efa\/\u66f4\u65b0&#xff09;\u6570\u636e<br \/>\n\u6570\u636e\u4f4d\u7f6e\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u9644\u52a0\u5728 URL \u4e4b\u540e (Query String)\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5305\u542b\u5728 HTTP \u8bf7\u6c42\u4f53 (Body) \u4e2d<\/p>\n<p>\n\u53ef\u89c1\u6027\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 GET\u660e\u6587\u663e\u793a\u5728\u5730\u5740\u680f&#xff0c;\u5bf9\u7528\u6237\u53ef\u89c1\u4e14\u53ef\u88ab\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u4fdd\u5b58 \u5bf9\u7528\u6237\u4e0d\u53ef\u89c1&#xff0c;\u4e0d\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u76f4\u63a5\u663e\u793a\u5728\u5730\u5740\u680f<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0 POST\u5b89\u5168\u6027 \u8f83\u4f4e\u3002\u56e0\u4e3a\u6570\u636e\u66b4\u9732\u5728 URL \u4e2d&#xff0c;\u4e0d\u9002\u5408\u4f20\u8f93\u5bc6\u7801\u7b49\u654f\u611f\u4fe1\u606f\u00a0\u00a0\u76f8\u5bf9\u8f83\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0 \u9ad8\u3002\u654f\u611f\u4fe1\u606f\u653e\u5728 Body \u91cc\u66f4\u5b89\u5168&#xff08;\u6ce8\u610f&#xff1a;\u8fd9\u4e0d\u4ee3\u8868\u52a0\u5bc6&#xff0c;HTTPS\u624d\u662f\u52a0\u5bc6\u4fdd\u969c&#xff09;<\/p>\n<p>\n\u6570\u636e\u957f\u5ea6\u9650\u5236\u00a0 \u00a0 \u00a0 GET\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6709\u00a0 \u00a0 \u00a0\u53d7\u9650\u4e8e\u6d4f\u89c8\u5668\u548c\u670d\u52a1\u5668\u5bf9 URL \u957f\u5ea6\u7684\u9650\u5236&#xff08;\u901a\u5e38\u4e3a\u51e0\u5343\u4e2a\u5b57\u7b26&#xff09;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0POST\u00a0 \u00a0 \u00a0 \u7406\u8bba\u4e0a\u65e0\u00a0 \u00a0 \u7406\u8bba\u4e0a\u53ef\u4ee5\u53d1\u9001\u975e\u5e38\u5927\u7684\u6570\u636e\u5305&#xff08;\u53d6\u51b3\u4e8e\u670d\u52a1\u5668\u7684\u914d\u7f6e&#xff09;<\/p>\n<p>\n\u6570\u636e\u7c7b\u578b\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 GET\u00a0 \u00a0 \u00a0 \u53ea\u5141\u8bb8 ASCII \u5b57\u7b26&#xff0c;\u9700\u8981\u8fdb\u884c URL \u7f16\u7801\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0POST\u00a0 \u00a0\u6ca1\u6709\u9650\u5236\u3002\u53ef\u4ee5\u662f\u4e8c\u8fdb\u5236\u6570\u636e&#xff08;\u5982\u56fe\u7247\u3001\u6587\u4ef6&#xff09;\u3001\u6587\u672c\u7b49\u3002<\/p>\n<p>\n\u540e\u9000\/\u5237\u65b0\u6309\u94ae\u00a0 \u00a0 \u00a0 GET\u65e0\u5bb3\u3002\u6d4f\u89c8\u5668\u901a\u5e38\u4f1a\u91cd\u65b0\u53d1\u8d77 GET \u8bf7\u6c42&#xff0c;\u4e0d\u4f1a\u63d0\u793a\u7528\u6237\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0POST\u6709\u98ce\u9669\u3002\u6d4f\u89c8\u5668\u4f1a\u5f39\u51fa\u4e00\u4e2a\u8b66\u544a&#xff0c;\u63d0\u793a\u7528\u6237\u662f\u5426\u8981\u91cd\u65b0\u63d0\u4ea4\u8868\u5355&#xff0c;\u56e0\u4e3a\u53ef\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u88ab\u518d\u6b21\u5904\u7406\u3002<\/p>\n<p>\n\u4e66\u7b7e\/\u5206\u4eab \u53ef\u4ee5\u5c06\u5e26\u53c2\u6570\u7684 URL \u76f4\u63a5\u6dfb\u52a0\u4e3a\u4e66\u7b7e\u6216\u5206\u4eab\u7ed9\u4ed6\u4eba\u3002 \u4e0d\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u4e66\u7b7e\u6216\u5206\u4eab URL \u6765\u91cd\u73b0\u4e00\u6b21 POST \u8bf7\u6c42\u3002<\/p>\n<h3>\u4e3e\u4f8b\u8bf4\u660e<\/h3>\n<h4>1. GET \u8bf7\u6c42\u793a\u4f8b<\/h4>\n<p>\u5f53\u4f60\u5728\u767e\u5ea6\u641c\u7d22 &#034;PHP&#034; \u65f6&#xff0c;\u4f60\u7684\u6d4f\u89c8\u5668\u4f1a\u5411\u767e\u5ea6\u7684\u670d\u52a1\u5668\u53d1\u9001\u4e00\u4e2a GET \u8bf7\u6c42\u3002<\/p>\n<p>* URL \u770b\u8d77\u6765\u50cf\u8fd9\u6837&#xff1a;<br \/>\n&#034;https:\/\/www.baidu.com\/s?wd&#061;PHP&#034;<br \/>\n* \u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f;<br \/>\n\u00a0 \u00a0* \u4f60\u5728\u6d4f\u89c8\u5668\u7684\u5730\u5740\u680f\u53ef\u4ee5\u770b\u5230\u5b8c\u6574\u7684\u641c\u7d22\u8bcd\u00a0<br \/>\n&#034;wd&#061;PHP&#034;\u3002<br \/>\n\u00a0 \u00a0* \u4f60\u53ef\u4ee5\u70b9\u51fb\u201c\u5237\u65b0\u201d\u6309\u94ae&#xff0c;\u91cd\u65b0\u8fdb\u884c\u8fd9\u6b21\u641c\u7d22&#xff0c;\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u3002<br \/>\n\u00a0 \u00a0* \u4f60\u53ef\u4ee5\u590d\u5236\u8fd9\u4e2a URL \u53d1\u7ed9\u670b\u53cb&#xff0c;\u4ed6\u4eec\u70b9\u5f00\u5c31\u80fd\u770b\u5230\u540c\u6837\u7684\u641c\u7d22\u7ed3\u679c\u3002<br \/>\n* \u8fd9\u662f\u5426\u7b26\u5408\u9884\u671f&#xff1f; \u5b8c\u5168\u7b26\u5408&#xff01;\u4f60\u53ea\u662f\u60f3\u83b7\u53d6\u5173\u4e8e &#034;PHP&#034; \u7684\u641c\u7d22\u7ed3\u679c&#xff0c;\u6ca1\u6709\u5bf9\u670d\u52a1\u5668\u505a\u4efb\u4f55\u66f4\u6539\u3002<\/p>\n<h4>2. POST \u8bf7\u6c42\u793a\u4f8b<\/h4>\n<p>\u5f53\u4f60\u5728\u4e00\u4e2a\u7535\u5546\u7f51\u7ad9&#xff08;\u5982\u6dd8\u5b9d&#xff09;\u4e0a\u586b\u5199\u5b8c\u6536\u8d27\u4fe1\u606f\u5e76\u63d0\u4ea4\u8ba2\u5355\u65f6&#xff0c;\u4f60\u7684\u6d4f\u89c8\u5668\u4f1a\u5411\u670d\u52a1\u5668\u53d1\u9001\u4e00\u4e2a POST \u8bf7\u6c42\u3002<\/p>\n<p>* URL \u770b\u8d77\u6765\u50cf\u8fd9\u6837&#xff1a;<br \/>\n&#034;https:\/\/trade.taobao.com\/trade\/itemlist\/list_buy.htm&#034;&#xff08;\u6ce8\u610f&#xff1a;URL \u4e2d\u6ca1\u6709\u5305\u542b\u4f60\u7684\u59d3\u540d\u3001\u5730\u5740\u7b49\u4fe1\u606f&#xff09;<br \/>\n* \u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f;<br \/>\n\u00a0 \u00a0* \u4f60\u7684\u6536\u8d27\u5730\u5740\u3001\u5546\u54c1\u4fe1\u606f\u7b49\u6570\u636e\u88ab\u6253\u5305\u5728\u4e86\u8bf7\u6c42\u7684 Body \u91cc\u53d1\u9001\u7ed9\u4e86\u670d\u52a1\u5668\u3002<br \/>\n\u00a0 \u00a0* \u6d4f\u89c8\u5668\u5730\u5740\u680f\u770b\u4e0d\u5230\u8fd9\u4e9b\u4fe1\u606f\u3002<br \/>\n\u00a0 \u00a0* \u5982\u679c\u4f60\u63d0\u4ea4\u8ba2\u5355\u540e\u70b9\u51fb\u201c\u5237\u65b0\u201d&#xff0c;\u6d4f\u89c8\u5668\u4f1a\u5f39\u51fa\u8b66\u544a\u6846&#xff1a;\u201c\u786e\u8ba4\u91cd\u65b0\u63d0\u4ea4\u8868\u5355\u5417&#xff1f;\u201d&#xff0c;\u56e0\u4e3a\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4f60\u4e0b\u4e86\u4e24\u4efd\u4e00\u6a21\u4e00\u6837\u7684\u8ba2\u5355&#xff01;<br \/>\n* \u8fd9\u662f\u5426\u7b26\u5408\u9884\u671f&#xff1f; \u5b8c\u5168\u7b26\u5408&#xff01;\u4f60\u662f\u5728\u521b\u5efa\u4e00\u7b14\u65b0\u7684\u4ea4\u6613\u8bb0\u5f55&#xff0c;\u8fd9\u4e2a\u884c\u4e3a\u6539\u53d8\u4e86\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002<\/p>\n<p>\u603b\u7ed3\u4e0e\u6700\u4f73\u5b9e\u8df5<\/p>\n<p>\u9009\u62e9 GET \u5f53&#8230; \u9009\u62e9 POST \u5f53&#8230;<br \/>\n\u4ece\u670d\u52a1\u5668\u83b7\u53d6\u6570\u636e&#xff08;\u5982\u52a0\u8f7d\u4e00\u4e2a\u9875\u9762\u3001\u641c\u7d22\u3001\u67e5\u770b\u5546\u54c1\u5217\u8868&#xff09;\u3002 \u5411\u670d\u52a1\u5668\u63d0\u4ea4\u6570\u636e&#xff08;\u5982\u767b\u5f55\u3001\u6ce8\u518c\u3001\u53d1\u8868\u8bc4\u8bba\u3001\u4e0b\u8ba2\u5355\u3001\u4e0a\u4f20\u6587\u4ef6&#xff09;\u3002<br \/>\n\u6570\u636e\u4e0d\u654f\u611f&#xff0c;\u53ef\u4ee5\u516c\u5f00\u3002 \u6570\u636e\u654f\u611f&#xff0c;\u5982\u5bc6\u7801\u3001\u94f6\u884c\u5361\u53f7\u3002<br \/>\n\u9700\u8981\u4e66\u7b7e\u6216\u5206\u4eab\u67d0\u4e2a\u7279\u5b9a\u72b6\u6001\u3002 \u9700\u8981\u4fee\u6539\u6216\u521b\u5efa\u670d\u52a1\u5668\u4e0a\u7684\u8d44\u6e90\u3002<br \/>\n\u6570\u636e\u91cf\u5f88\u5c0f&#xff0c;\u4e14\u662f\u7b80\u5355\u7684\u6587\u672c\u3002 \u6570\u636e\u91cf\u5f88\u5927&#xff0c;\u6216\u8005\u662f\u6587\u4ef6\u3001\u56fe\u50cf\u7b49\u590d\u6742\u6570\u636e\u3002<\/p>\n<p>\u91cd\u8981\u63d0\u9192&#xff1a;<\/p>\n<p>* \u5b89\u5168\u4e0d\u662f\u7531 GET\/POST \u51b3\u5b9a\u7684&#xff0c;\u800c\u662f\u7531 HTTPS \u51b3\u5b9a\u7684\u3002 \u4f7f\u7528 HTTPS \u534f\u8bae\u4f1a\u5bf9\u6574\u4e2a\u901a\u4fe1\u8fc7\u7a0b&#xff08;\u5305\u62ec URL \u548c\u8bf7\u6c42\u4f53&#xff09;\u8fdb\u884c\u52a0\u5bc6&#xff0c;\u4ece\u800c\u4fdd\u62a4\u6570\u636e\u5b89\u5168\u3002<br \/>\n* \u4e0d\u8981\u4ec5\u4f9d\u8d56 GET \u6765\u201c\u9690\u85cf\u201d\u654f\u611f\u6570\u636e\u3002 \u56e0\u4e3a URL \u4f1a\u88ab\u4fdd\u5b58\u5728\u670d\u52a1\u5668\u65e5\u5fd7\u3001\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\u3001Referer \u5934\u4e2d&#xff0c;\u8fd9\u4e9b\u5730\u65b9\u90fd\u53ef\u80fd\u6cc4\u9732\u6570\u636e\u3002<br \/>\n* \u6c38\u8fdc\u4e0d\u8981\u5c06\u5173\u952e\u64cd\u4f5c&#xff08;\u5982\u5220\u9664\u3001\u652f\u4ed8&#xff09;\u901a\u8fc7 GET \u5b9e\u73b0\u3002 \u8fd9\u975e\u5e38\u5371\u9669&#xff0c;\u56e0\u4e3a\u7528\u6237\u53ef\u80fd\u65e0\u610f\u4e2d\u89e6\u53d1\u4e86\u5e26\u6709\u6076\u610f\u94fe\u63a5\u7684\u9875\u9762&#xff0c;\u6216\u8005\u641c\u7d22\u5f15\u64ce\u722c\u866b\u8bbf\u95ee\u4e86\u8fd9\u4e9b URL\u3002<\/p>\n<p>\u7406\u89e3\u5e76\u6b63\u786e\u5e94\u7528 GET \u548c POST \u662f\u6784\u5efa\u5b89\u5168\u3001\u53ef\u9760\u3001\u7b26\u5408\u89c4\u8303\u7684 Web \u5e94\u7528\u7684\u57fa\u7840\u3002<br \/>\n\u597d\u7684&#xff0c;\u6211\u4eec\u6765\u8be6\u7ec6\u8bb2\u89e3\u4e00\u4e0b PHP \u4e2d\u7684\u5404\u79cd\u8fd0\u7b97\u7b26\u548c\u5e38\u89c1\u7684\u6807\u7b7e\u3002<\/p>\n<h2>PHP\u4e2d\u8fd0\u7b97\u7b26<\/h2>\n<h3>1. \u7b97\u672f\u8fd0\u7b97\u7b26<\/h3>\n<p>\u7528\u4e8e\u57fa\u672c\u7684\u6570\u5b66\u8fd0\u7b97\u3002<\/p>\n<p>\u8fd0\u7b97\u7b26\u00a0 \u00a0\u00a0\u540d\u79f0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u63cf\u8ff0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u793a\u4f8b\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u7ed3\u679c<\/p>\n<p>&#034;&#043;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u52a0\u6cd5\u00a0 \u00a0 \u5de6\u53f3\u64cd\u4f5c\u6570\u4e4b\u548c\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0 &#034;10 &#043; 2&#034;\u00a0 \u00a0 \u00a0 &#034;12&#034;<\/p>\n<p>&#034;-&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u51cf\u6cd5\u00a0 \u00a0 \u5de6\u53f3\u64cd\u4f5c\u6570\u4e4b\u5dee\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;10 &#8211; 2&#034;\u00a0 \u00a0 \u00a0 \u00a0 &#034;8&#034;<\/p>\n<p>&#034;*&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4e58\u6cd5\u00a0 \u00a0 \u5de6\u53f3\u64cd\u4f5c\u6570\u4e4b\u79ef\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;10 * 2&#034;\u00a0 \u00a0 \u00a0 \u00a0&#034;20&#034;<\/p>\n<p>&#034;\/&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u9664\u6cd5\u00a0 \u00a0 \u5de6\u64cd\u4f5c\u6570\u9664\u4ee5\u53f3\u64cd\u4f5c\u6570\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;10 \/ 2&#034;\u00a0 \u00a0 \u00a0 \u00a0 &#034;5&#034;<\/p>\n<p>&#034;%&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u53d6\u6a21\u00a0 \u00a0 \u5de6\u64cd\u4f5c\u6570\u9664\u4ee5\u53f3\u64cd\u4f5c\u6570\u7684\u4f59\u6570\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;10 % 3&#034;\u00a0 \u00a0 \u00a0 &#034;1&#034;<\/p>\n<p>&#034;**&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6c42\u5e42\u00a0 \u00a0 \u5de6\u64cd\u4f5c\u6570\u7684\u53f3\u64cd\u4f5c\u6570\u6b21\u65b9\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0&#034;2 ** 3&#034;\u00a0 \u00a0 \u00a0 \u00a0 &#034;8&#034;<\/p>\n<h3>2. \u8d4b\u503c\u8fd0\u7b97\u7b26<\/h3>\n<p>\u7528\u4e8e\u4e3a\u53d8\u91cf\u8d4b\u503c\u3002<\/p>\n<p>\u8fd0\u7b97\u7b26\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u63cf\u8ff0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7b49\u4ef7\u4e8e<\/p>\n<p>&#034;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6700\u57fa\u672c\u7684\u8d4b\u503c\u8fd0\u7b97\u7b26\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &#061; $b&#034;<\/p>\n<p>&#034;&#043;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u52a0\u540e\u518d\u8d4b\u503c\u00a0&#034;$a &#043;&#061; $b&#034; \u2192\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;$a &#061; $a &#043; $b&#034;<\/p>\n<p>&#034;-&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u51cf\u540e\u518d\u8d4b\u503c\u00a0&#034;$a -&#061; $b&#034; \u2192\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &#061; $a &#8211; $b&#034;<\/p>\n<p>&#034;*&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4e58\u540e\u518d\u8d4b\u503c\u00a0&#034;$a *&#061; $b&#034; \u2192\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;$a &#061; $a * $b&#034;<\/p>\n<p>&#034;\/&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u9664\u540e\u518d\u8d4b\u503c\u00a0&#034;$a \/&#061; $b&#034; \u2192\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0&#034;$a &#061; $a \/ $b&#034;<\/p>\n<p>&#034;.&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\u540e\u518d\u8d4b\u503c\u00a0&#034;$a .&#061; $b&#034; \u2192\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &#061; $a . $b&#034;<\/p>\n<p>&#034;%&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u53d6\u6a21\u540e\u518d\u8d4b\u503c\u00a0&#034;$a %&#061; $b&#034; \u2192\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &#061; $a % $b&#034;<\/p>\n<p>&#034;**&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6c42\u5e42\u540e\u518d\u8d4b\u503c (PHP 5.6&#043;)\u00a0&#034;$a **&#061; $b&#034; \u2192\u00a0&#034;$a &#061; $a ** $b&#034;<\/p>\n<h3>3. \u6bd4\u8f83\u8fd0\u7b97\u7b26<\/h3>\n<p>\u7528\u4e8e\u6bd4\u8f83\u4e24\u4e2a\u503c&#xff0c;\u8fd4\u56de&#034;true&#034; \u6216\u00a0&#034;false&#034;\u3002<\/p>\n<p>\u8fd0\u7b97\u7b26\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u540d\u79f0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u63cf\u8ff0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u793a\u4f8b\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u7ed3\u679c (\u5f53 a&#061;5, b&#061;10)<\/p>\n<p>&#034;&#061;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u7b49\u4e8e\u00a0 \u00a0 \u00a0 \u00a0 \u5982\u679c\u503c\u76f8\u7b49\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &#061;&#061; $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 &#034;false&#034;<\/p>\n<p>&#034;&#061;&#061;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5168\u7b49\u00a0 \u00a0 \u00a0 \u00a0 \u5982\u679c\u503c\u548c\u7c7b\u578b\u90fd\u76f8\u7b49\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &#061;&#061;&#061; 5&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;true&#034;<\/p>\n<p>&#034;!&#061;&#034;\u6216\u00a0 &#034;&lt;&gt;&#034;\u00a0 \u00a0 \u4e0d\u7b49\u4e8e\u00a0 \u00a0 \u5982\u679c\u503c\u4e0d\u76f8\u7b49\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;$a !&#061; $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;true&#034;<\/p>\n<p>&#034;!&#061;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4e0d\u5168\u7b49\u00a0 \u00a0 \u5982\u679c\u503c\u6216\u7c7b\u578b\u4e0d\u76f8\u7b49\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;$a !&#061;&#061; &#039;5&#039; &#034;\u00a0 \u00a0 \u00a0 \u00a0 &#034;true&#034;<\/p>\n<p>&#034;&gt;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u00a0\u5927\u4e8e\u00a0 \u00a0 \u00a0 \u00a0 \u5982\u679c\u5de6\u64cd\u4f5c\u6570\u5927\u4e8e\u53f3\u64cd\u4f5c\u6570\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &gt; $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;false&#034;<\/p>\n<p>&#034;&lt;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5c0f\u4e8e\u00a0 \u00a0 \u00a0 \u00a0 \u5982\u679c\u5de6\u64cd\u4f5c\u6570\u5c0f\u4e8e\u53f3\u64cd\u4f5c\u6570\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &lt; $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;true&#034;<\/p>\n<p>&#034;&gt;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5927\u4e8e\u7b49\u4e8e \u5982\u679c\u5de6\u64cd\u4f5c\u6570\u4e0d\u5c0f\u4e8e\u53f3\u64cd\u4f5c\u6570\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &gt;&#061; 10&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;false&#034;<\/p>\n<p>&#034;&lt;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5c0f\u4e8e\u7b49\u4e8e \u5982\u679c\u5de6\u64cd\u4f5c\u6570\u4e0d\u5927\u4e8e\u53f3\u64cd\u4f5c\u6570\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0&#034;$a &lt;&#061; 5&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;true&#034;<\/p>\n<p>&#034;&lt;&#061;&gt;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u592a\u7a7a\u8239\u8fd0\u7b97\u7b26 \u6bd4\u8f83\u5927\u5c0f&#xff0c;\u5de6\u8fb9\u5927\u8fd4\u56de1&#xff0c;\u76f8\u7b49<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u8fd4\u56de0&#xff0c;\u53f3\u8fb9\u5927\u8fd4\u56de-1\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;$a &lt;&#061;&gt; $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;-1&#034;<\/p>\n<h3>4. \u903b\u8f91\u8fd0\u7b97\u7b26<\/h3>\n<p>\u7528\u4e8e\u7ec4\u5408\u6761\u4ef6\u8bed\u53e5\u3002<\/p>\n<p>\u8fd0\u7b97\u7b26\u00a0 \u00a0 \u00a0 \u00a0\u540d\u79f0\u00a0 \u00a0 \u00a0 \u00a0 \u63cf\u8ff0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u793a\u4f8b\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u7ed3\u679c (\u5f53 a&#061;true, b&#061;false)<\/p>\n<p>&#034;and&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4e0e\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5982\u679c\u5de6\u53f3\u90fd\u4e3a\u771f\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;$a and $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 &#034;false&#034;<\/p>\n<p>&#034;or&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6216\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5982\u679c\u5de6\u53f3\u6709\u4e00\u4e2a\u4e3a\u771f\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 &#034;$a or $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;true&#034;<\/p>\n<p>&#034;xor&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5f02\u6216\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5982\u679c\u5de6\u53f3\u53ea\u6709\u4e00\u4e2a\u4e3a\u771f\u5219\u4e3a\u771f\u00a0 \u00a0&#034;$a xor $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;true&#034;<\/p>\n<p>&#034;!&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u975e\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u53d6\u53cd&#xff0c;\u5982\u679c\u4e3a\u5047\u5219\u4e3a\u771f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;!$a&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;false&#034;<\/p>\n<p>&#034;&amp;&amp;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4e0e\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4e0e&#034;and&#034; \u540c&#xff0c;\u4f46\u4f18\u5148\u7ea7\u66f4\u9ad8\u00a0 \u00a0 \u00a0 \u00a0\u00a0 &#034;$a &amp;&amp; $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;false&#034;<\/p>\n<p>&#034;\\\\|\\\\|&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u6216\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4e0e\u00a0 &#034;or&#034; \u540c&#xff0c;\u4f46\u4f18\u5148\u7ea7\u66f4\u9ad8\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;$a \\\\|\\\\| $b&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#034;true&#034;<\/p>\n<p>\u6ce8\u610f&#xff1a;<br \/>\n&#034;and&#034;\/ &#034;or&#034; \u7684\u4f18\u5148\u7ea7\u4f4e\u4e8e\u00a0&#034;&#061;&#034;&#xff0c;\u800c\u00a0&#034;&amp;&amp;&#034;\/ &#034;||&#034; \u7684\u4f18\u5148\u7ea7\u9ad8\u4e8e\u00a0&#034;&#061;&#034;\u3002<\/p>\n<h3>\n5. \u9012\u589e\/\u9012\u51cf\u8fd0\u7b97\u7b26<\/h3>\n<p>\u5bf9\u53d8\u91cf\u8fdb\u884c &#043;1 \u6216 -1 \u64cd\u4f5c\u3002<\/p>\n<p>\u8fd0\u7b97\u7b26\u00a0 \u00a0 \u00a0 \u00a0\u540d\u79f0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u63cf\u8ff0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u793a\u4f8b\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(\u5047\u8bbe $a&#061;5)<\/p>\n<p>&#034;&#043;&#043;$a&#034;\u00a0 \u00a0 \u00a0 \u00a0\u524d\u9012\u589e\u00a0 \u00a0 \u00a0\u5148\u8ba9 a \u52a0 1&#xff0c;\u518d\u8fd4\u56de \u00a0a \u7684\u503c\u00a0 \u00a0 \u00a0 \u00a0&#034;echo &#043;&#043;$a;&#034;\u00a0 \u00a0 \u00a0 \u8f93\u51fa\u00a0&#034;6&#034;<\/p>\n<p>&#034;$a&#043;&#043;&#034;\u00a0 \u00a0 \u00a0 \u00a0\u540e\u9012\u589e\u00a0 \u00a0 \u00a0\u5148\u8fd4\u56de a \u7684\u503c&#xff0c;\u518d\u8ba9 \u00a0a \u52a0 1\u00a0 \u00a0 \u00a0 \u00a0 &#034;echo $a&#043;&#043;;&#034;\u00a0 \u00a0 \u00a0\u8f93\u51fa\u00a0&#034;5&#034;<\/p>\n<p>&#034;&#8211;$a&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u524d\u9012\u51cf\u00a0 \u00a0 \u5148\u8ba9 a \u51cf 1&#xff0c;\u518d\u8fd4\u56de \u00a0a \u7684\u503c\u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;echo &#8211;$a;&#034;\u00a0 \u00a0 \u00a0 \u00a0\u8f93\u51fa\u00a0&#034;4&#034;<\/p>\n<p>&#034;$a&#8211;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u540e\u9012\u51cf\u00a0 \u00a0 \u5148\u8fd4\u56de a \u7684\u503c&#xff0c;\u518d\u8ba9 \u00a0a \u51cf 1\u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034;echo $a&#8211;;&#034;\u00a0 \u00a0 \u00a0 \u00a0\u8f93\u51fa\u00a0&#034;5&#034;<\/p>\n<h3>6. \u5b57\u7b26\u4e32\u8fd0\u7b97\u7b26<\/h3>\n<p>\u4e13\u95e8\u7528\u4e8e\u8fde\u63a5\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u8fd0\u7b97\u7b26\u00a0 \u00a0 \u00a0 \u00a0 \u540d\u79f0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u63cf\u8ff0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u793a\u4f8b\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7ed3\u679c<\/p>\n<p>&#034;.&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8fde\u63a5\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5c06\u5de6\u53f3\u4e24\u4e2a\u5b57\u7b26\u4e32\u8fde\u63a5\u8d77\u6765\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#034; &#034;Hel&#034; . &#034;lo&#034; &#034;\u00a0 \u00a0 \u00a0&#034;&#034;Hello&#034;&#034;<\/p>\n<p>&#034;.&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8fde\u63a5\u8d4b\u503c\u00a0 \u00a0 \u00a0\u5c06\u53f3\u8fb9\u7684\u5b57\u7b26\u4e32\u8ffd\u52a0\u5230\u5de6\u8fb9\u7684\u53d8\u91cf\u540e\u9762\u00a0 \u00a0&#034;$str &#061; &#034;Hi&#034;; $str .&#061; &#034; there!&#034;;&#034;\u00a0<br \/>\n&#034;$str&#034; \u7684\u503c\u4e3a&#034;&#034;Hi there!&#034;&#034;<\/p>\n<h3>7. \u6570\u7ec4\u8fd0\u7b97\u7b26<\/h3>\n<p>\u4e13\u95e8\u7528\u4e8e\u5408\u5e76\u548c\u64cd\u4f5c\u6570\u7ec4\u3002<\/p>\n<p><span style=\"color:#4da8ee\">\u8fd0\u7b97\u7b26\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u540d\u79f0\u00a0<\/span><\/p>\n<p>&#034;&#043;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8054\u5408\u00a0<\/p>\n<p><span style=\"color:#4da8ee\">\u63cf\u8ff0<\/span><br \/>\n&#034;$a &#043; $b&#034;&#xff0c;\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u4e86\u00a0<br \/>\n&#034;$a&#034; \u4e2d\u6240\u6709\u5143\u7d20\u548c\u00a0<br \/>\n&#034;$b&#034; \u4e2d\u6240\u6709\u5143\u7d20\u7684\u5e76\u96c6\u3002<br \/>\n&#034;$b&#034; \u4e2d\u4e0e\u00a0<br \/>\n&#034;$a&#034; \u952e\u540d\u76f8\u540c\u7684\u5143\u7d20\u4f1a\u88ab\u5ffd\u7565\u3002<\/p>\n<p>&#034;&#061;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u76f8\u7b49\u00a0<\/p>\n<p><span style=\"color:#4da8ee\">\u63cf\u8ff0<\/span><br \/>\n&#034;$a &#061;&#061; $b&#034;&#xff0c;\u5982\u679c\u00a0<br \/>\n&#034;$a&#034; \u548c\u00a0<br \/>\n&#034;$b&#034; \u5177\u6709\u76f8\u540c\u7684\u952e\/\u503c\u5bf9\u5219\u4e3a\u00a0<br \/>\n&#034;true&#034;\u3002<\/p>\n<p>&#034;&#061;&#061;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5168\u7b49<\/p>\n<p><span style=\"color:#4da8ee\">\u63cf\u8ff0\u00a0<\/span><br \/>\n&#034;$a &#061;&#061;&#061; $b&#034;&#xff0c;\u5982\u679c\u00a0<br \/>\n&#034;$a&#034; \u548c\u00a0<br \/>\n&#034;$b&#034; \u5177\u6709\u76f8\u540c\u7684\u952e\/\u503c\u5bf9\u5e76\u4e14\u987a\u5e8f\u76f8\u540c\u3001\u7c7b\u578b\u76f8\u540c\u5219\u4e3a\u00a0<br \/>\n&#034;true&#034;\u3002<\/p>\n<p>&#034;!&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6216\u00a0<\/p>\n<p><span style=\"color:#4da8ee\">\u63cf\u8ff0<\/span><br \/>\n&#034;&lt;&gt;&#034; \u4e0d\u76f8\u7b49\u00a0<br \/>\n&#034;$a !&#061; $b&#034;&#xff0c;\u5982\u679c\u00a0<br \/>\n&#034;$a&#034; \u4e0d\u7b49\u4e8e\u00a0<br \/>\n&#034;$b&#034; \u5219\u4e3a\u00a0<br \/>\n&#034;true&#034;\u3002<\/p>\n<p>&#034;!&#061;&#061;&#034;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4e0d\u5168\u7b49\u00a0<\/p>\n<p><span style=\"color:#4da8ee\">\u63cf\u8ff0<\/span><br \/>\n&#034;$a !&#061;&#061; $b&#034;&#xff0c;\u5982\u679c\u00a0<br \/>\n&#034;$a&#034; \u4e0d\u5168\u7b49\u4e8e\u00a0<br \/>\n&#034;$b&#034; \u5219\u4e3a\u00a0<br \/>\n&#034;true&#034;\u3002<\/p>\n<h2>PHP \u7684\u5e38\u89c1\u6807\u7b7e<\/h2>\n<p>PHP \u811a\u672c\u9700\u8981\u7528\u7279\u6b8a\u7684\u754c\u5b9a\u7b26\u5305\u56f4\u8d77\u6765&#xff0c;\u4ee5\u4fbf\u670d\u52a1\u5668\u8bc6\u522b\u54ea\u90e8\u5206\u662f PHP \u4ee3\u7801\u3002<\/p>\n<h3><span style=\"color:#fe2c24\">1. \u6807\u51c6\u6807\u7b7e<\/span><\/h3>\n<p>\u8fd9\u662f\u6700\u5e38\u7528\u7684\u5199\u6cd5&#xff0c;\u5728\u6240\u6709\u7248\u672c\u7684 PHP \u4e2d\u90fd\u53ef\u7528\u3002<\/p>\n<p>&lt;?php<br \/>\n\/\/ \u8fd9\u91cc\u662f PHP \u4ee3\u7801<br \/>\n?&gt;<\/p>\n<h3>2. \u77ed\u6807\u7b7e<\/h3>\n<p>\u8fd9\u662f\u4e00\u79cd\u7b80\u77ed\u7684\u5199\u6cd5&#xff0c;\u4f46\u4f9d\u8d56\u4e8e\u670d\u52a1\u5668\u7684\u914d\u7f6e&#xff08;<br \/>\n&#034;short_open_tag&#034;&#xff09;\u3002<\/p>\n<p>&lt;?<br \/>\n\/\/ \u8fd9\u91cc\u662f PHP \u4ee3\u7801<br \/>\n?&gt;<\/p>\n<h3>3. ASP \u98ce\u683c\u6807\u7b7e<\/h3>\n<p>\u6a21\u4eff ASP\/JSP \u98ce\u683c\u7684\u5199\u6cd5&#xff0c;\u540c\u6837\u4f9d\u8d56\u4e8e\u670d\u52a1\u5668\u7684\u914d\u7f6e&#xff08;<br \/>\n&#034;asp_tags&#034;&#xff09;\u3002<\/p>\n<p>&lt;%<br \/>\n\/\/ \u8fd9\u91cc\u662f PHP \u4ee3\u7801<br \/>\n%&gt;<\/p>\n<h3>4. HTML \u811a\u672c\u6807\u7b7e<\/h3>\n<p>\u4e00\u79cd\u517c\u5bb9\u65e7\u7cfb\u7edf\u7684\u5199\u6cd5\u3002<\/p>\n<p>&lt;script language&#061;&#034;php&#034;&gt;<br \/>\n\/\/ \u8fd9\u91cc\u662f PHP \u4ee3\u7801<br \/>\n&lt;\/script&gt;<\/p>\n<h3>\u5efa\u8bae<\/h3>\n<p>1. \u9996\u9009\u6807\u51c6\u6807\u7b7e (&#034;&lt;?php ?&gt;&#034;)&#xff1a;\u4e3a\u4e86\u4fdd\u8bc1\u4ee3\u7801\u7684\u53ef\u79fb\u690d\u6027\u548c\u517c\u5bb9\u6027&#xff0c;\u5f3a\u70c8\u5efa\u8bae\u59cb\u7ec8\u4f7f\u7528\u6807\u51c6\u6807\u7b7e\u3002\u907f\u514d\u4f7f\u7528\u77ed\u6807\u7b7e\u6216 ASP \u6807\u7b7e&#xff0c;\u56e0\u4e3a\u4f60\u65e0\u6cd5\u4fdd\u8bc1\u90e8\u7f72\u4ee3\u7801\u7684\u670d\u52a1\u5668\u5f00\u542f\u4e86\u76f8\u5e94\u914d\u7f6e\u3002<br \/>\n2. \u7701\u7565\u7ed3\u675f\u6807\u7b7e (&#034;?&gt;&#034;)&#xff1a;\u5f53\u4e00\u4e2a PHP \u6587\u4ef6\u53ea\u5305\u542b PHP \u4ee3\u7801&#xff08;\u6ca1\u6709 HTML&#xff09;\u6216\u8005\u5728\u6587\u4ef6\u7684\u672b\u5c3e\u65f6&#xff0c;\u6700\u4f73\u5b9e\u8df5\u662f\u7701\u7565\u6700\u540e\u7684\u7ed3\u675f\u6807\u7b7e\u00a0&#034;?&gt;&#034;\u3002\u8fd9\u53ef\u4ee5\u907f\u514d\u56e0\u610f\u5916\u7684\u7a7a\u683c\u6216\u6362\u884c\u5bfc\u81f4\u7684\u5934\u90e8\u5df2\u53d1\u9001\u9519\u8bef (Headers already sent)\u3002<br \/>\n&lt;?php<br \/>\n\/\/ &#8230; \u4e00\u5927\u5806 PHP \u4ee3\u7801 &#8230;<br \/>\n\/\/ \u8fd9\u91cc\u4ec0\u4e48\u90fd\u4e0d\u5199&#xff0c;\u4e0d\u5199 ?&gt;<br \/>\n3. \u5408\u7406\u4f7f\u7528\u8fd0\u7b97\u7b26<br \/>\n\u00a0 \u00a0* \u5728\u8fdb\u884c\u6570\u503c\u6bd4\u8f83\u65f6&#xff0c;\u5982\u679c\u9700\u8981\u4e25\u683c\u7684\u7c7b\u578b\u548c\u503c\u90fd\u76f8\u540c&#xff0c;\u8bf7\u52a1\u5fc5\u4f7f\u7528\u00a0<br \/>\n&#034;&#061;&#061;&#061;&#034; \u548c\u00a0<br \/>\n&#034;!&#061;&#061;&#034;\u3002<br \/>\n\u00a0 \u00a0* \u5bf9\u4e8e\u590d\u6742\u7684\u903b\u8f91\u5224\u65ad&#xff0c;\u4f18\u5148\u4f7f\u7528\u00a0<br \/>\n&#034;&amp;&amp;&#034; \u548c\u00a0<br \/>\n&#034;||&#034;&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u6bd4\u00a0<br \/>\n&#034;and&#034;\/<br \/>\n&#034;or&#034; \u66f4\u76f4\u89c2\u4e14\u4f18\u5148\u7ea7\u4e0d\u6613\u51fa\u9519\u3002<br \/>\n\u00a0 \u00a0* \u5728\u5904\u7406\u7528\u6237\u8f93\u5165\u6216\u4e0d\u786e\u5b9a\u6570\u636e\u65f6&#xff0c;\u4f7f\u7528\u677e\u6563\u6bd4\u8f83 (<br \/>\n&#034;&#061;&#061;&#034;) \u65f6\u8981\u683c\u5916\u5c0f\u5fc3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u8bed\u8a00PHP&#xff08;\u5168\u79f0&#xff1a;PHP: Hypertext Preprocessor&#xff0c;\u5373\u201c\u8d85\u6587\u672c\u9884\u5904\u7406\u5668\u201d&#xff09;\u662f\u4e00\u79cd\u5f00\u6e90\u3001\u901a\u7528\u7684\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00&#xff0c;\u5c24\u5176\u9002\u5408 Web \u5f00\u53d1\u3002\u5b83\u53ef\u5d4c\u5165 HTML&#xff0c;\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u5e76\u751f\u6210\u52a8\u6001\u5185\u5bb9&#xff08;\u5982\u7f51\u9875\u3001\u63a5\u53e3&#xff09;&#xff0c;\u518d\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\u3002\u53d1\u5c55\u5386\u53f2* 1994\u5e74&#xff1a;Rasmus Lerdorf \u4e3a\u7ba1\u7406\u4e2a\u4eba\u4e3b\u9875\u521b\u5efa\u4e86 PHP \u96cf\u5f62\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[230,275,43],"topic":[],"class_list":["post-74246","post","type-post","status-publish","format-standard","hentry","category-server","tag-php","tag-web","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/74246.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"PHP\u8bed\u8a00PHP&#xff08;\u5168\u79f0&#xff1a;PHP: Hypertext Preprocessor&#xff0c;\u5373\u201c\u8d85\u6587\u672c\u9884\u5904\u7406\u5668\u201d&#xff09;\u662f\u4e00\u79cd\u5f00\u6e90\u3001\u901a\u7528\u7684\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00&#xff0c;\u5c24\u5176\u9002\u5408 Web \u5f00\u53d1\u3002\u5b83\u53ef\u5d4c\u5165 HTML&#xff0c;\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u5e76\u751f\u6210\u52a8\u6001\u5185\u5bb9&#xff08;\u5982\u7f51\u9875\u3001\u63a5\u53e3&#xff09;&#xff0c;\u518d\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\u3002\u53d1\u5c55\u5386\u53f2* 1994\u5e74&#xff1a;Rasmus Lerdorf \u4e3a\u7ba1\u7406\u4e2a\u4eba\u4e3b\u9875\u521b\u5efa\u4e86 PHP \u96cf\u5f62\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/74246.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-09T06:05:41+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/74246.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/74246.html\",\"name\":\"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-09T06:05:41+00:00\",\"dateModified\":\"2026-02-09T06:05:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/74246.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/74246.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/74246.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/74246.html","og_locale":"zh_CN","og_type":"article","og_title":"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"PHP\u8bed\u8a00PHP&#xff08;\u5168\u79f0&#xff1a;PHP: Hypertext Preprocessor&#xff0c;\u5373\u201c\u8d85\u6587\u672c\u9884\u5904\u7406\u5668\u201d&#xff09;\u662f\u4e00\u79cd\u5f00\u6e90\u3001\u901a\u7528\u7684\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00&#xff0c;\u5c24\u5176\u9002\u5408 Web \u5f00\u53d1\u3002\u5b83\u53ef\u5d4c\u5165 HTML&#xff0c;\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u5e76\u751f\u6210\u52a8\u6001\u5185\u5bb9&#xff08;\u5982\u7f51\u9875\u3001\u63a5\u53e3&#xff09;&#xff0c;\u518d\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\u3002\u53d1\u5c55\u5386\u53f2* 1994\u5e74&#xff1a;Rasmus Lerdorf \u4e3a\u7ba1\u7406\u4e2a\u4eba\u4e3b\u9875\u521b\u5efa\u4e86 PHP \u96cf\u5f62\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/74246.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-09T06:05:41+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/74246.html","url":"https:\/\/www.wsisp.com\/helps\/74246.html","name":"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-09T06:05:41+00:00","dateModified":"2026-02-09T06:05:41+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/74246.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/74246.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/74246.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Web\u5b89\u5168\u57fa\u7840\u76f8\u5173\u77e5\u8bc63.0\uff08\u540e\u7aef\u670d\u52a1\u5668\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/74246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=74246"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/74246\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=74246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=74246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=74246"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=74246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}