{"id":48,"date":"2023-06-05T13:29:50","date_gmt":"2023-06-05T05:29:50","guid":{"rendered":"http:\/\/pro369.com\/php\/?p=48"},"modified":"2023-06-05T13:31:01","modified_gmt":"2023-06-05T05:31:01","slug":"php%e7%a8%8b%e5%bc%8f%e7%b6%b2%e9%a0%81%e7%94%9f%e6%88%90%e9%9d%9c%e6%85%8b%e9%a0%81%e9%9d%a2%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/por.tw\/php\/php%e7%a8%8b%e5%bc%8f%e7%b6%b2%e9%a0%81%e7%94%9f%e6%88%90%e9%9d%9c%e6%85%8b%e9%a0%81%e9%9d%a2%e7%9a%84%e6%96%b9%e6%b3%95\/","title":{"rendered":"PHP\u7a0b\u5f0f\u7db2\u9801\u751f\u6210\u975c\u614b\u9801\u9762\u7684\u65b9\u6cd5"},"content":{"rendered":"<p><span style=\"color: #008000;\"><strong>\u5728PHP\u7db2\u7ad9\u958b\u767c\u4e2d\u70ba\u4e86\u7db2\u7ad9\u63a8\u5ee3\u548cSEO\u7b49\u9700\u8981\uff0c\u9700\u8981\u5c0d\u7db2\u7ad9\u9032\u884c\u5168\u7ad9\u6216\u5c40\u90e8\u975c\u614b\u5316\u8655\u7406\uff0cPHP\u751f\u6210\u975c\u614bHTML\u9801\u9762\u6709\u591a\u7a2e\u65b9\u6cd5<\/strong><\/span><br \/>\n<span style=\"color: #800080;\"><strong>\u4f8b\u5982\uff1a\u5229\u7528PHP\u7bc4\u672c\u3001\u5feb\u53d6\u7b49\u5be6\u73fe\u9801\u9762\u975c\u614b\u5316<\/strong><\/span><br \/>\n\u4eca\u5929\u5c31\u4ee5PHP\u6848\u4f8b\u6559\u5b78\u5f62\u5f0f\u8a0e\u8ad6PHP\u751f\u6210\u975c\u614b\u9801\u9762\u7684\u65b9\u6cd5\u3002<br \/>\n<span style=\"color: #ff00ff;\"><strong>\u9801\u9762\u975c\u614b\u5316\u7684\u65b9\u6cd5\uff0c\u5206\u70ba\u5169\u7a2e<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u4e00\u7a2e\u662f\u507d\u975c\u614b\uff0c\u5c31\u662furl \u91cd\u5beb<br \/>\n\u4e00\u7a2e\u662f\u4f60\u771f\u7684\u975c\u614b\u5316\u3002<\/strong><\/span><br \/>\n\u4e0b\u9762\u4ecb\u7d39PHP\u4e2d\u9801\u9762\u975c\u614b\u5316\u7684\u65b9\u6cd5\u3002<br \/>\n<span style=\"color: #0000ff; font-size: large;\"><strong>\u4ec0\u9ebc\u662fPHP\u7a0b\u5f0f\u7db2\u9801\u975c\u614b\u5316\uff1f<\/strong><\/span><br \/>\n<strong>PHP\u7a0b\u5f0f\u7db2\u9801\u975c\u614b\u5316\u7684\u7c21\u55ae\u7406\u89e3\u5c31\u662f\u4f7f\u7db2\u7ad9\u751f\u6210\u9801\u9762\u4ee5\u975c\u614bHTML\u7684\u5f62\u5f0f\u5c55\u73fe\u5728\u8a2a\u5ba2\u9762\u524d<br \/>\nPHP\u975c\u614b\u5316\u5206\u7d14\u975c\u614b\u5316\u548c\u507d\u975c\u614b\u5316\uff0c\u5169\u8005\u7684\u5340\u5225\u5728\u65bcPHP\u751f\u6210\u975c\u614b\u9801\u9762\u7684\u8655\u7406\u6a5f\u5236\u4e0d\u540c\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/visdacom.com\/php\/wp-content\/uploads\/2019\/08\/PHP-Website-Design-4.jpg\" alt=\"\" class=\"alignnone wp-image-377 size-full\" width=\"650\" height=\"433\" srcset=\"https:\/\/por.tw\/php\/wp-content\/uploads\/2019\/08\/PHP-Website-Design-4.jpg 650w, https:\/\/por.tw\/php\/wp-content\/uploads\/2019\/08\/PHP-Website-Design-4-262x175.jpg 262w, https:\/\/por.tw\/php\/wp-content\/uploads\/2019\/08\/PHP-Website-Design-4-270x180.jpg 270w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><br \/>\n<\/strong><br \/>\n<span style=\"color: #ff00ff; font-size: large;\"><strong>PHP\u7a0b\u5f0f\u7db2\u9801\u751f\u6210\u975c\u614bHTML\u9801\u9762\u7684\u65b9\u6cd5\uff1a<\/strong><\/span><br \/>\n<strong>1\u3001\u5229\u7528PHP\u7bc4\u672c\u751f\u6210\u975c\u614b\u9801\u9762<\/strong><br \/>\nPHP\u7bc4\u672c\u5be6\u73fe\u975c\u614b\u5316\u975e\u5e38\u65b9\u4fbf\uff0c\u6bd4\u5982\u5b89\u88dd\u548c\u4f7f\u7528PHP Smarty\u5be6\u73fe\u7db2\u7ad9\u975c\u614b\u5316\u3002<br \/>\n<strong>2\u3001\u4f7f\u7528PHP\u6a94\u6848\u8b80\u5beb\u529f\u80fd\u751f\u6210\u975c\u614b\u9801\u9762<\/strong><br \/>\n<span style=\"font-size: 16px; color: #800000;\"><strong>PHP\u751f\u6210\u975c\u614b\u9801\u9762\u6848\u4f8b\u4ee3\u78bc<\/strong><\/span><br \/>\n&lt;?<br \/>\n$out1 = &#8220;&lt;html&gt;&lt;head&gt;&lt;title&gt;PHP\u7a0b\u5f0f\u7db2\u9801\u975c\u614b\u5316\u6559\u5b78&lt;\/title&gt;&lt;\/head&gt;<br \/>\n&lt;body&gt;\u6b61\u8fce\u8a2a\u554fPHP\u7db2\u7ad9\u958b\u767c\u6559\u5b78\u7db2http:\/\/por.tw\uff0c\u672c\u6587\u4e3b\u8981\u4ecb\u7d39PHP\u7db2\u7ad9\u9801\u9762\u975c\u614b\u5316\u7684\u65b9\u6cd5<br \/>\n&lt;\/body&gt;&lt;\/html&gt;&#8221;;<br \/>\n$fp = fopen(&#8220;leapsoulcn.html&#8221;,&#8221;w&#8221;);<br \/>\nif(!$fp)<br \/>\n{<br \/>\necho &#8220;System Error&#8221;;<br \/>\nexit();<br \/>\n}<br \/>\nelse {<br \/>\nfwrite($fp,$out1);<br \/>\nfclose($fp);<br \/>\necho &#8220;Success&#8221;;<br \/>\n}<br \/>\n?&gt;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<span style=\"color: #ff0000;\"><strong>\u00a0\u00a0\u00a0 3\u3001\u4f7f\u7528PHP\u8f38\u51fa\u63a7\u5236\u51fd\u6578\uff08Output Control\uff09\u751f\u6210\u975c\u614b\u9801\u9762<\/strong><\/span><br \/>\n<span style=\"color: #008000;\"><strong>\u00a0\u00a0\u00a0 \u8f38\u51fa\u63a7\u5236\u51fd\u6578\uff08Output Control\uff09\u4e5f\u5c31\u662f\u4f7f\u7528\u548c\u63a7\u5236\u5feb\u53d6\u4f86\u751f\u6210\u975c\u614bHTML\u9801\u9762\uff0c\u4e5f\u6703\u4f7f\u7528\u5230PHP\u6a94\u6848\u8b80\u5beb\u51fd\u6578\u3002<\/strong><\/span><br \/>\n<span style=\"color: #008000;\"><strong>\u00a0\u00a0\u00a0 PHP\u751f\u6210\u975c\u614b\u9801\u9762\u6848\u4f8b\u4ee3\u78bc<\/strong><\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n&lt;?<br \/>\nob_start();<br \/>\necho &#8220;&lt;html&gt;&#8221;.<br \/>\n&#8220;&lt;head&gt;&#8221;.<br \/>\n&#8220;&lt;title&gt;PHP\u7db2\u7ad9\u975c\u614b\u5316\u6559\u5b78&lt;\/title&gt;&#8221;.<br \/>\n&#8220;&lt;\/head&gt;&#8221;.<br \/>\n&#8220;&lt;body&gt;\u6b61\u8fce\u8a2a\u554fPHP\u7db2\u7ad9\u958b\u767c\u6559\u5b78\u7db2http:\/\/por.tw\uff0c\u672c\u6587\u4e3b\u8981\u4ecb\u7d39PHP\u7db2\u7ad9\u9801\u9762\u975c\u614b\u5316\u7684\u65b9\u6cd5&lt;\/body&gt;&#8221;.<br \/>\n&#8220;&lt;\/html&gt;&#8221;;<br \/>\n$out1 = ob_get_contents();<br \/>\nob_end_clean();<br \/>\n$fp = fopen(&#8220;leapsoulcn.html&#8221;,&#8221;w&#8221;);<br \/>\nif(!$fp)<br \/>\n{<br \/>\necho &#8220;System Error&#8221;;<br \/>\nexit();<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nfwrite($fp,$out1);<br \/>\nfclose($fp);<br \/>\necho &#8220;Success&#8221;;<br \/>\n}<br \/>\n?&gt;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n\u6211\u5011\u77e5\u9053\u4f7f\u7528PHP\u9032\u884c\u7db2\u7ad9\u958b\u767c\uff0c\u4e00\u822c\u57f7\u884c\u7d50\u679c\u76f4\u63a5\u8f38\u51fa\u5230\u904a\u89bd\u5668\uff0c\u70ba\u4e86\u4f7f\u7528PHP\u751f\u6210\u975c\u614b\u9801\u9762\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u8f38\u51fa\u63a7\u5236\u51fd\u6578\u63a7\u5236\u5feb\u53d6\u5340\uff0c\u4ee5\u4fbf\u53d6\u5f97\u5feb\u53d6\u5340\u7684\u5167\u5bb9\uff0c\u7136\u5f8c\u518d\u8f38\u51fa\u5230\u975c\u614bHTML\u9801\u9762\u6a94\u6848\u4e2d\u4ee5\u5be6\u73fe\u7db2\u7ad9\u975c\u614b\u5316\u3002<br \/>\n<span style=\"color: #ff0000; font-size: large;\"><strong> PHP\u751f\u6210\u975c\u614b\u9801\u9762\u7684\u601d\u8def\u70ba\uff1a<\/strong><\/span><br \/>\n\u9996\u5148\u958b\u555f\u5feb\u53d6\uff0c\u7136\u5f8c\u8f38\u51fa\u4e86HTML\u5167\u5bb9\uff08\u4f60\u4e5f\u53ef\u4ee5\u901a\u904einclude\u5c07HTML\u5167\u5bb9\u4ee5\u6a94\u6848\u5f62\u5f0f\u5305\u62ec\u9032\u4f86\uff09\uff0c\u4e4b\u5f8c\u53d6\u5f97\u5feb\u53d6\u4e2d\u7684\u5167\u5bb9\uff0c\u6e05\u7406\u5feb\u53d6\u5f8c\u901a\u904ePHP\u6a94\u6848\u8b80\u5beb\u51fd\u6578\u5c07\u5feb\u53d6\u5167\u5bb9\u5beb\u5165\u5230\u975c\u614bHTML\u9801\u9762\u6a94\u6848\u4e2d\u3002<br \/>\n<span style=\"font-size: medium;\"><strong>\u7372\u5f97\u8f38\u51fa\u7684\u5feb\u53d6\u5167\u5bb9\u4ee5\u751f\u6210\u975c\u614bHTML\u9801\u9762\u7684\u904e\u7a0b\u9700\u8981\u4f7f\u7528\u4e09\u500b\u51fd\u6578\uff1a<br \/>\nob_start()\u3001ob_get_contents()\u3001ob_end_clean()\u3002<\/strong><\/span><br \/>\n<span style=\"color: #ff00ff; font-size: large;\"><strong>\u00a0\u00a0 PHP\u7a0b\u5f0f\u7db2\u9801\u751f\u6210\u975c\u614b\u9801\u9762\u77e5\u8b58\uff1a<\/strong><\/span><br \/>\n<strong>\u00a0\u00a0 1\u3001ob_start\u51fd\u6578\u4e00\u822c\u4e3b\u8981\u662f\u7528\u4f86\u958b\u555f\u5feb\u53d6\uff0c\u6ce8\u610f\u4f7f\u7528ob_start\u4e4b\u524d\u4e0d\u80fd\u6709\u4efb\u4f55\u8f38\u51fa\uff0c\u5982\u7a7a\u683c\u3001\u5b57\u5143\u7b49\u3002<\/strong><br \/>\n<strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\u3001ob_get_contents\u51fd\u6578\u4e3b\u8981\u7528\u4f86\u53d6\u5f97\u5feb\u53d6\u4e2d\u7684\u5167\u5bb9\u4ee5\u5b57\u4e32\u5f62\u5f0f\u8fd4\u56de\uff0c\u6ce8\u610f\u6b64\u51fd\u6578\u5fc5\u9808\u5728ob_end_clean\u51fd\u6578\u4e4b\u524d\u547c\u53eb\uff0c\u5426\u5247\u53d6\u5f97\u4e0d\u5230\u5feb\u53d6\u5167\u5bb9\u3002<\/strong><br \/>\n<strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u3001ob_end_clean\u51fd\u6578\u4e3b\u8981\u662f\u6e05\u7406\u5feb\u53d6\u4e2d\u7684\u5167\u5bb9\u4e26\u95dc\u9589\u5feb\u53d6\uff0c\u5b8c\u6210\u5247\u8fd4\u56deTrue\uff0c\u5931\u6557\u5247\u8fd4\u56deFalse<\/strong><br \/>\nPHP\u8f38\u51fa\u63a7\u5236\u51fd\u6578\uff08Output Control\uff09\u6709\u5f88\u591a\u61c9\u7528\u3002<br \/>\n<span style=\"color: #800000;\"><strong>\u81f3\u6b64\uff0c\u4f7f\u7528PHP\u751f\u6210\u975c\u614bHTML\u9801\u9762\u4ee5\u5be6\u73fe\u7db2\u7ad9\u975c\u614b\u5316\u7684\u65b9\u6cd5\u5c31\u4ecb\u7d39\u5b8c\u4e86\uff0c\u6839\u64da\u5be6\u969b\u60c5\u6cc1\u548c\u9700\u6c42\u4f60\u53ef\u4ee5\u9078\u53d6\u4e0d\u540c\u7684\u975c\u614b\u5316\u65b9\u6cd5\u3002<\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728PHP\u7db2\u7ad9\u958b\u767c\u4e2d\u70ba\u4e86\u7db2\u7ad9\u63a8\u5ee3\u548cSEO\u7b49\u9700\u8981\uff0c\u9700\u8981\u5c0d\u7db2\u7ad9\u9032\u884c\u5168\u7ad9\u6216\u5c40\u90e8\u975c\u614b\u5316\u8655\u7406\uff0cPHP\u751f\u6210\u975c\u614bHTML\u9801\u9762\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":377,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[22],"class_list":["post-48","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php"],"_links":{"self":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/48"}],"collection":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":1,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/48\/revisions\/509"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media\/377"}],"wp:attachment":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}