{"id":5137,"date":"2022-04-08T11:10:14","date_gmt":"2022-04-08T03:10:14","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=5137"},"modified":"2022-04-08T11:10:14","modified_gmt":"2022-04-08T03:10:14","slug":"php%e5%88%a4%e6%96%adtxt%e6%96%87%e4%bb%b6%e6%98%af%e5%90%a6%e4%b8%ba%e7%a9%ba","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/5137.html","title":{"rendered":"php\u5224\u65adtxt\u6587\u4ef6\u662f\u5426\u4e3a\u7a7a"},"content":{"rendered":"

php\u5224\u65adtxt\u6587\u4ef6\u662f\u5426\u4e3a\u7a7a<\/h2>\n
function istxt($txt)\r\n{\r\n\r\n    $content = @file_get_contents($txt);\r\n    if ($content === false) {\r\n        echo '\u65e0\u6cd5\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9';\r\n    } elseif (strlen($content) === 0) {\r\n        echo '\u6587\u4ef6\u6ca1\u6709\u5185\u5bb9';\r\n    } else {\r\n        echo '\u4e0d\u662f\u7a7a\u6587\u4ef6';\r\n    }\r\n}\r\n\r\nreturn istxt($txt = \"\/text.txt\");\r\n<\/code><\/pre>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

php\u5224\u65adtxt\u6587\u4ef6\u662f\u5426\u4e3a\u7a7a function istxt($txt) { $content = @file_ […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1656],"class_list":["post-5137","post","type-post","status-publish","format-standard","hentry","category-web","tag-phptxt"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=5137"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5137\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=5137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=5137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=5137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}