{"id":"238","uid":"1","name":"apiphpcode","title":"PHP\u6e90\u7801\u793a\u4f8b\uff08API\uff09","category_id":"281","description":"","root":"0","pid":"0","model_id":"2","type":"2","position":"0","link_id":"0","cover_id":"0","display":"1","deadline":"0","attach":"0","view":"0","comment":"0","extend":"0","level":"0","create_time":"1473059557","update_time":"1473059557","status":"1","parse":"0","content":"
<?php\r\n$appkey=\"2f5er1f5fghnj324kkmbvkasmdkfffdd\";\t\t\/\/appkey\r\n$baseurl=\"http:\/\/book.picp.net\";\t\t\t\/\/\u8bf7\u6c42\u670d\u52a1\u5668\u57fa\u5730\u5740\r\n$param=array(\t\t\t\t\t\t\/\/\u8bf7\u6c42\u53c2\本\r\n\t\"barcode\"=>'000000026'\r\n);\r\n\r\n\/\/\u5c06\u8bf7\u6c42\u53c2\本\u7ec4\u88c5\u4e3a \u952e\u540d=\u952e\u503c \体育\u5b57\u7b26\u4e32\r\n$encode_list=array();\r\nforeach($param as $key=>$item)\r\n{\r\n\t$encode_list[]=\"{$key}={$item}\";\r\n}\r\n$encode_str=implode(\"&\",$encode_list);\r\n\r\n\/\/\u5c06\u7ec4\u88c5\u597d\体育 \u53c2\本\u5b57\u7b26\u4e32\u8fde\u63a5appkey\下载\u5e76\u7528md5\u52a0\u5bc6,\u6240\u6709\体育\u8bf7\u6c42\u53c2\本\u90fd\u5fc5\u987b\u53c2\u4e0e\u52a0\u5bc6\r\n$sign_str=$encode_str.$appkey;\r\n$sign_str=md5($sign_str);\r\n\/\/\u7ec4\u88c5\u8bf7\u6c42api,\u5c06\u4e0a\u9762\u52a0\u5bc6\u597d\体育\u5b57\u7b26\u4e32\u653e\u5728signstr\u53c2\本\u91cc\r\n\r\n$url_addr=$baseurl.\"\/Api\/Book\/info?\".$encode_str.\"&signstr=\".$sign_str;\r\n\r\n\r\n$content=file_get_contents($url_addr);\r\n\r\n$content=json_decode($content);\r\nvar_dump($content);\r\nexit();\r\n<\/pre>","template":"","bookmark":"0"}