{"id":49116,"date":"2024-12-02T16:28:34","date_gmt":"2024-12-02T08:28:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/49116\/"},"modified":"2024-12-02T16:28:34","modified_gmt":"2024-12-02T08:28:34","slug":"php%e6%a0%87%e7%ad%be","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/49116\/","title":{"rendered":"PHP\u6807\u7b7e"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>PHP\u6807\u7b7e<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p><span style=\"font-size: 15px\">\u5b66\u4e60\u77e5\u8bc6\u8981\u5584\u4e8e\u601d\u8003\uff0c\u601d\u8003\uff0c\u518d\u601d\u8003\uff01\u4eca\u5929\u7c73\u4e91\u5c0f\u7f16\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aPHP\u6807\u7b7e\u300b<\/span>\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u5305\u542b<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\u6216\u51c6\u5907\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u5c31\u90fd\u4e0d\u8981\u9519\u8fc7\u672c\u6587\u5566~\u8ba9\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff0c\u80fd\u5e2e\u52a9\u5230\u4f60\u5c31\u66f4\u597d\u4e86\uff01<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241110\/1731221682673058b2b74d6.jpg\" class=\"aligncenter\" title=\"PHP\u6807\u7b7e\u63d2\u56fe\" alt=\"PHP\u6807\u7b7e\u63d2\u56fe\" \/><\/p>\n<p>\u5728 php \u4e2d\uff0c\u6709\u591a\u79cd\u7c7b\u578b\u7684\u6807\u7b7e\u53ef\u7528\u4e8e\u5c06 php \u4ee3\u7801\u5d4c\u5165 html \u6216\u5176\u4ed6\u6587\u6863\u4e2d\u3002\u8ba9\u6211\u4eec\u9010\u4e00\u8ba8\u8bba\u5b83\u4eec\u3001\u5b83\u4eec\u7684\u5dee\u5f02\u3001\u652f\u6301\u7684\u7248\u672c\u4ee5\u53ca\u5982\u4f55\u542f\u7528\u6216\u7981\u7528\u5b83\u4eec\u3002<\/p>\n<h2> \u6807\u51c6 php \u6807\u7b7e <\/h2>\n<p>\u8fd9\u662f\u6807\u51c6 php \u6807\u7b7e\u7684\u8bed\u6cd5\uff1a<\/p>\n<pre>&lt;?php\n    echo \"bismillah!\";\n?&gt;\n<\/pre>\n<ul>\n<li>\u652f\u6301\u7248\u672c\uff1aphp 4 \u53ca\u66f4\u9ad8\u7248\u672c\u3002<\/li>\n<li>\u9ed8\u8ba4\u59cb\u7ec8\u542f\u7528\uff0c\u65e0\u6cd5\u7981\u7528\u3002<\/li>\n<li>\u63a8\u8350\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<h2> \u77ed\u5f00\u653e\u6807\u7b7e (&lt;? &#8230; ?&gt;) <\/h2>\n<p>\u8fd9\u4e9b\u662f\u6807\u51c6 php \u6807\u7b7e\u7684\u7b80\u5199\u3002\u8fd9\u662f\u8bed\u6cd5\uff1a<\/p>\n<pre>&lt;?\n    echo \"alhamdulillah\";\n?&gt;\n<\/pre>\n<ul>\n<li>\u652f\u6301\u7248\u672c\uff1aphp 3 \u53ca\u66f4\u9ad8\u7248\u672c<\/li>\n<li>\u53ef\u4ee5\u901a\u8fc7 php.ini \u4e2d\u7684 short_open_tag \u6307\u4ee4\u542f\u7528\u6216\u7981\u7528<\/li>\n<li> \u542f\u7528\uff1ashort_open_tag = on <\/li>\n<li> \u7981\u7528\uff1ashort_open_tag = off <\/li>\n<li>\u4e0d\u5efa\u8bae\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u4eec\u53ef\u80fd\u4e0e xml \u58f0\u660e\u51b2\u7a81\u3002<\/li>\n<\/ul>\n<h2> \u77ed echo \u6807\u7b7e (&lt;?= &#8230; ?&gt;) <\/h2>\n<p>\u8fd9\u4e9b\u662f &lt;?php echo &#8230; ?&gt;<br \/> \u7684\u7b80\u5199 <\/p>\n<pre>&lt;?= $message; ?&gt;\n<\/pre>\n<ul>\n<li> \u652f\u6301\u7248\u672c\uff1aphp 5.4 \u53ca\u66f4\u9ad8\u7248\u672c<\/li>\n<li> \u542f\u7528\/\u7981\u7528\uff1a\u5728 php 5.4 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\u59cb\u7ec8\u542f\u7528\uff0c\u65e0\u8bba short_open_tag \u6307\u4ee4\u5982\u4f55\u3002<\/li>\n<li> \u4f7f\u7528\u5b83\u4eec\u8fdb\u884c\u8f93\u51fa\uff0c\u4f46\u786e\u4fdd\u670d\u52a1\u5668\u5df2\u542f\u7528\u5b83\u4eec\u3002<\/li>\n<\/ul>\n<h2> asp \u6837\u5f0f\u6807\u7b7e (&lt;% &#8230; %&gt;) <\/h2>\n<p>\u8fd9\u4e9b\u6807\u7b7e\u7c7b\u4f3c\u4e8e asp \u6216 jsp \u6837\u5f0f\u6807\u7b7e\uff1a<\/p>\n<pre>&lt;%\n    echo \"assalamu alaikum\";\n%&gt;\n<\/pre>\n<ul>\n<li> \u652f\u6301\u7248\u672c\uff1aphp 3 \u81f3 php 7.0<\/li>\n<li> \u53ef\u4ee5\u901a\u8fc7 php.ini \u4e2d\u7684 asp_tags \u6307\u4ee4\u542f\u7528\u6216\u7981\u7528\uff08\u4ece php 7.0 \u5f00\u59cb\u5df2\u5220\u9664\uff09<\/li>\n<li> \u542f\u7528\uff1aasp_tags = \u5f00 <\/li>\n<li> \u7981\u7528\uff1aasp_tags = \u5173\u95ed <\/li>\n<li> \u73b0\u4ee3\u7248\u672c\u7684 php \u4e0d\u518d\u652f\u6301\u8fd9\u4e9b\u3002<\/li>\n<\/ul>\n<h2> \u811a\u672c\u6807\u7b7e <\/h2>\n<p>\u6b64\u8bed\u6cd5\u5141\u8bb8\u60a8\u50cf\u811a\u672c\u5757\u4e00\u6837\u5c06 php \u4ee3\u7801\u5d4c\u5165\u5230 html \u4e2d\u3002<\/p>\n<pre>&lt;script language=\"php\"&gt;\n    echo \"This is a script tag.\";\n&lt;\/script&gt;\n<\/pre>\n<ul>\n<li> \u652f\u6301\u7248\u672c\uff1aphp 3 \u53ca\u66f4\u9ad8\u7248\u672c\u3002<\/li>\n<li> \u8fd9\u4e9b\u59cb\u7ec8\u542f\u7528\uff0c\u4f46\u5728\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5f88\u5c11\u4f7f\u7528\u3002 xhtml \u548c\u8f83\u65b0\u7248\u672c\u7684 html \u4e0d\u652f\u6301\u3002<\/li>\n<\/ul>\n<p>\u4eca\u5929\u5173\u4e8e\u300aPHP\u6807\u7b7e\u300b\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u662f\u4e0d\u662f\u5b66\u8d77\u6765\u4e00\u76ee\u4e86\u7136\uff01\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u5185\u5bb9\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<p> \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb \u5220\u9664<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u6807\u7b7e \u6536\u85cf \u5b66\u4e60\u77e5\u8bc6\u8981\u5584\u4e8e\u601d\u8003\uff0c\u601d\u8003\uff0c\u518d\u601d\u8003\uff01\u4eca\u5929\u7c73\u4e91\u5c0f\u7f16\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765\u300aPHP\u6807\u7b7e\u300b\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u5305\u542b\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\u6216\u51c6\u5907\u5b66\u4e60\u6587\u7ae0\uff0c\u5c31\u90fd\u4e0d\u8981\u9519\u8fc7\u672c\u6587\u5566~\u8ba9\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff0c\u80fd\u5e2e\u52a9\u5230\u4f60\u5c31\u66f4\u597d\u4e86\uff01 \u5728 php \u4e2d\uff0c\u6709\u591a\u79cd\u7c7b\u578b\u7684\u6807\u7b7e\u53ef\u7528\u4e8e\u5c06 php \u4ee3\u7801\u5d4c\u5165 html \u6216\u5176\u4ed6\u6587\u6863\u4e2d\u3002\u8ba9\u6211\u4eec\u9010\u4e00\u8ba8\u8bba\u5b83\u4eec\u3001\u5b83\u4eec\u7684\u5dee\u5f02\u3001\u652f\u6301\u7684\u7248\u672c\u4ee5\u53ca\u5982\u4f55\u542f\u7528\u6216\u7981\u7528\u5b83\u4eec\u3002 \u6807\u51c6 php \u6807\u7b7e \u8fd9\u662f\u6807\u51c6 php \u6807\u7b7e\u7684\u8bed\u6cd5\uff1a &lt;?php echo &#8220;bismillah!&#8221;; ?&gt; \u652f\u6301\u7248\u672c\uff1aphp 4 \u53ca\u66f4\u9ad8\u7248\u672c\u3002 \u9ed8\u8ba4\u59cb\u7ec8\u542f\u7528\uff0c\u65e0\u6cd5\u7981\u7528\u3002 \u63a8\u8350\u4f7f\u7528\u3002 \u77ed\u5f00\u653e\u6807\u7b7e (&lt;? &#8230; ?&gt;) \u8fd9\u4e9b\u662f\u6807\u51c6 php \u6807\u7b7e\u7684\u7b80\u5199\u3002\u8fd9\u662f\u8bed\u6cd5\uff1a &lt;? echo &#8220;alhamdulillah&#8221;; ?&gt; \u652f\u6301\u7248\u672c\uff1aphp 3 \u53ca\u66f4\u9ad8\u7248\u672c \u53ef\u4ee5\u901a\u8fc7 php.ini \u4e2d\u7684 short_open_tag \u6307\u4ee4\u542f\u7528\u6216\u7981\u7528 \u542f\u7528\uff1ashort_open_tag = on \u7981\u7528\uff1ashort_open_tag = off \u4e0d\u5efa\u8bae\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u4eec\u53ef\u80fd\u4e0e xml \u58f0\u660e\u51b2\u7a81\u3002 \u77ed echo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-49116","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=49116"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49116\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=49116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=49116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=49116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}