{"id":83,"date":"2023-06-05T13:15:48","date_gmt":"2023-06-05T05:15:48","guid":{"rendered":"http:\/\/pro369.com\/php\/?p=83"},"modified":"2019-04-16T16:01:49","modified_gmt":"2019-04-16T16:01:49","slug":"%e4%bd%bf%e7%94%a8php%e7%a8%8b%e5%bc%8f%e8%aa%9e%e8%a8%80%e6%94%ab%e5%8f%96%e4%bb%a3%e7%a2%bc%e6%a1%88%e4%be%8b","status":"publish","type":"post","link":"https:\/\/por.tw\/php\/%e4%bd%bf%e7%94%a8php%e7%a8%8b%e5%bc%8f%e8%aa%9e%e8%a8%80%e6%94%ab%e5%8f%96%e4%bb%a3%e7%a2%bc%e6%a1%88%e4%be%8b\/","title":{"rendered":"\u4f7f\u7528PHP\u7a0b\u5f0f\u8a9e\u8a00\u652b\u53d6\u4ee3\u78bc\u6848\u4f8b"},"content":{"rendered":"<p><font size=\"3\" style=\"background-color: #ffff00\"><strong>PHP\u652b\u53d6\u4ee3\u78bc\u6848\u4f8b\uff0c\u652f\u63f4\u6b63\u5247\u8868\u9054\u5f0f\u8a2d\u5b9a\u5f9e\u958b\u59cb\u5230\u7d50\u675f\u5340\u529f\u80fd\u8b8a\u6578\uff0c\u4ee3\u78bc\u5982\u4e0b\uff1a<\/strong><\/font><\/p>\n<p> &lt;?php&nbsp;&nbsp;&nbsp; &nbsp;<br \/> function preg_substr($start, $end, $str) \/\/ \u6b63\u5247\u622a\u53d6\u51fd\u6578&nbsp;&nbsp;&nbsp; &nbsp;<br \/> {&nbsp;&nbsp;&nbsp; &nbsp;<br \/> &nbsp;&nbsp;&nbsp; $temp = preg_split($start, $str);&nbsp;&nbsp;&nbsp; &nbsp;<br \/> &nbsp;&nbsp;&nbsp; $content = preg_split($end, $temp[1]);&nbsp;&nbsp;&nbsp; &nbsp;<br \/> &nbsp;&nbsp;&nbsp; return $content[0];&nbsp;&nbsp;&nbsp; &nbsp;<br \/> } &nbsp;<br \/> function str_substr($start, $end, $str) \/\/ \u5b57\u4e32\u622a\u53d6\u51fd\u6578&nbsp;&nbsp;&nbsp; &nbsp;<br \/> {&nbsp;&nbsp;&nbsp; &nbsp;<br \/> &nbsp;&nbsp;&nbsp; $temp = explode($start, $str, 2);&nbsp;&nbsp;&nbsp; &nbsp;<br \/> &nbsp;&nbsp;&nbsp; $content = explode($end, $temp[1], 2);&nbsp;&nbsp;&nbsp; &nbsp;<br \/> &nbsp;&nbsp;&nbsp; return $content[0];&nbsp;&nbsp;&nbsp; &nbsp;<br \/> } &nbsp;<br \/> <strong style=\"background-color: #99ccff\">\/\/ &#8212;&#8212;&#8212;&#8212;&#8212;- \u4f7f\u7528\u6848\u4f8b &#8212;&#8212;&#8212;&#8212;&#8212;- &nbsp;<\/strong><br \/> $str = iconv(&quot;UTF-8&quot;, &quot;big5&quot;, file_get_contents(&quot;http:\/\/www.mycodes.net&quot;));&nbsp; &nbsp;<br \/> echo (&#39;\u6a19\u984c: &#39; . str_substr(&quot;&lt;title&gt;&quot;, &quot;&lt;\/title&gt;&quot;, $str)); \/\/ \u901a\u904e\u5b57\u4e32\u63d0\u53d6\u6a19\u984c &nbsp;<br \/> echo (&#39;\u4f5c\u8005: &#39; . preg_substr(&quot;\/userid=d+&quot;&gt;\/&quot;, &quot;\/&lt;\/\/&quot;, $str)); \/\/ \u901a\u904e\u6b63\u5247\u63d0\u53d6\u4f5c\u8005 &nbsp;<br \/> echo (&#39;\u5167\u5bb9: &#39; . str_substr(&#39;&lt;div class=&quot;content&quot;&gt;&#39;, &#39;&lt;\/div&gt;&#39;, $str)); \/\/\u5167\u5bb9\u7576\u7136\u4e0d\u53ef\u4ee5\u5c11 &nbsp;<br \/> ?&gt;&nbsp; &nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u652b\u53d6\u4ee3\u78bc\u6848\u4f8b\uff0c\u652f\u63f4\u6b63\u5247\u8868\u9054\u5f0f\u8a2d\u5b9a\u5f9e\u958b\u59cb\u5230\u7d50\u675f\u5340\u529f\u80fd\u8b8a\u6578\uff0c\u4ee3\u78bc\u5982\u4e0b\uff1a &lt;?php&nbsp;&#038;nbs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":398,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[22],"class_list":["post-83","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\/83"}],"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=83"}],"version-history":[{"count":0,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media\/398"}],"wp:attachment":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}