html\u6587\u4ef6\u5939\u8f6capk<\/a>\u901a\u8fc7HTTP\u8bf7\u6c42\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u901a\u4fe1\uff0c\u670d\u52a1\u5668\u901a\u8fc7PHP\u811a\u672c\u5904\u7406\u8bf7\u6c42\uff0c\u7136\u540e\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5b89\u5353\u5ba2\u6237\u7aef\u3002<\/p>\n3. \u5b89\u5353\u5e94\u7528\u4e0ePHP\u901a\u4fe1<\/p>\n
\u5b89\u5353\u5e94\u7528\u901a\u8fc7HTTP\u8bf7\u6c42\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u901a\u4fe1\uff0c\u670d\u52a1\u5668\u901a\u8fc7PHP\u811a\u672c\u5904\u7406\u8bf7\u6c42\uff0c\u5e76\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5b89\u5353\u5e94\u7528\u3002<\/p>\n
\u5728\u5b89\u5353\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528HttpURLConnection\u7c7b\u6216HttpClient\u7c7b\u6765\u53d1\u9001HTTP\u8bf7\u6c42\u3002HttpURLConnection\u7c7b\u662fJava\u7684\u6807\u51c6\u7c7b\uff0c\u53ef\u4ee5\u53d1\u9001HTTP\u8bf7\u6c42\u5e76\u63a5\u6536\u54cd\u5e94\u3002HttpClient\u7c7b\u5219\u662fApache\u7684\u5f00\u6e90\u7c7b\u5e93\uff0c\u4e5f\u53ef\u4ee5\u53d1\u9001HTTP\u8bf7\u6c42\u5e76\u63a5\u6536\u54cd\u5e94\u3002\u5728\u5b89\u5353\u5e94\u7528\u4e2d\uff0c\u901a\u5e38\u4f7f\u7528HttpClient\u7c7b\u6765\u53d1\u9001HTTP\u8bf7\u6c42\u3002<\/p>\n
\u5728PHP\u811a\u672c\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528$_REQUEST\u6570\u7ec4\u6765\u83b7\u53d6\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u53c2\u6570\u3002$_REQUEST\u6570\u7ec4\u5305\u542b\u4e86\u6765\u81eaGET\u3001POST\u548cCOOKIE\u4e09\u79cd\u8bf7\u6c42\u65b9\u5f0f\u7684\u53c2\u6570\u3002\u5728PHP\u811a\u672c\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528echo\u8bed\u53e5\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n
4. \u5b89\u5353\u5e94\u7528\u4e0eMySQL\u901a\u4fe1<\/p>\n
MySQL\u662f\u4e00\u79cd\u5e38\u7528\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff0c\u5b83\u53ef\u4ee5\u4e0ePHP\u4e00\u8d77\u4f7f\u7528\uff0c\u4ee5\u4fbf\u4ece\u6570\u636e\u5e93\u4e2d\u68c0\u7d22\u6570\u636e\u5e76\u5c06\u5176\u8fd4\u56de\u7ed9\u5b89\u5353\u5e94\u7528\u3002<\/p>\n
\u5728PHP\u811a\u672c\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528mysqli_connect()\u51fd\u6570\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93\u3002\u8fde\u63a5\u6210\u529f\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528mysqli_query()\u51fd\u6570\u6267\u884cSQL\u8bed\u53e5\uff0c\u5e76\u4f7f\u7528mysqli_fetch_array()\u51fd\u6570\u5c06\u67e5\u8be2\u7ed3\u679c\u4ee5\u6570\u7ec4\u7684\u5f62\u5f0f\u8fd4\u56de\u3002\u5728PHP\u811a\u672c\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528echo\u8bed\u53e5\u5c06\u67e5\u8be2\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n
\u5728\u5b89\u5353\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528JSON\u683c\u5f0f\u89e3\u6790PHP\u8fd4\u56de\u7684\u67e5\u8be2\u7ed3\u679c\u3002JSON\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f\uff0c\u53ef\u4ee5\u5c06\u590d\u6742\u7684\u6570\u636e\u7ed3\u6784\u4ee5\u7b80\u5355\u7684\u65b9\u5f0f\u8868\u793a\u3002\u5728\u5b89\u5353\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528JSONObject\u548cJSONArray\u7c7b\u6765\u89e3\u6790JSON\u683c\u5f0f\u7684\u6570\u636e\u3002<\/p>\n
\u603b\u7ed3<\/p>\n
\u5b89\u5353\u548cPHP\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d\u6709\u7740\u7d27\u5bc6\u7684\u8054\u7cfb\u3002\u5728\u5b89\u5353\u5e94\u7528\u4e2d\uff0cPHP\u53ef\u4ee5\u4f5c\u4e3a\u670d\u52a1\u5668\u7aef\u8bed\u8a00\uff0c\u4e3a\u79fb\u52a8\u5e94\u7528\u63d0\u4f9b\u540e\u7aef\u670d\u52a1\u3002\u5b89\u5353\u5e94\u7528\u901a\u8fc7HTTP\u8bf7\u6c42\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u901a\u4fe1\uff0c\u670d\u52a1\u5668\u901a\u8fc7PHP\u811a\u672c\u5904\u7406\u8bf7\u6c42\uff0c\u5e76\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5b89\u5353\u5e94\u7528\u3002\u5728\u5b89\u5353\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528HttpClient\u7c7b\u53d1\u9001HTTP\u8bf7\u6c42\uff0c\u53ef\u4ee5\u4f7f\u7528JSON\u683c\u5f0f\u89e3\u6790PHP\u8fd4\u56de\u7684\u67e5\u8be2\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5b89\u5353\u662f\u6307\u57fa\u4e8eLinux\u5185\u6838\u7684\u79fb\u52a8\u64cd\u4f5c\u7cfb\u7edf\uff0c\u800cPHP\u5219\u662f\u4e00\u79cd\u5e38\u7528\u7684\u5f00\u6e90\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00\uff0c\u5e38\u7528\u4e8eWeb\u5f00\u53d1\u3002\u5b89\u5353\u548cPHP\u770b\u4f3c\u4e0d\u76f8\u5173\uff0c\u4f46\u662f\u5b83\u4eec\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d\u5374\u6709\u7740\u7d27\u5bc6\u7684\u8054\u7cfb\u3002\u672c\u6587\u5c06\u4ece\u539f\u7406\u548c\u8be6\u7ec6\u4ecb\u7ecd\u4e24\u65b9\u9762<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9436,637,1398,197,5317],"topic":[],"class_list":["post-5013","post","type-post","status-publish","format-standard","hentry","category-kaifaapp","tag-android-app-apk","tag-637","tag-1398","tag-197","tag-exe"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/5013","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=5013"}],"version-history":[{"count":0,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/5013\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=5013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=5013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=5013"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=5013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}