Home  >  Article  >  Backend Development  >  PHP的curl请求json

PHP的curl请求json

WBOY
WBOYOriginal
2016-06-23 14:39:141259browse

刚学PHP不久,遇到个问题。

用PHP做登录,请求JSON如下:
action=login&sitekey=asfdae545642a1sdf55&str={"uname":"name","upass":"pass123"}
成功返回:
{"c":"0000","d":{"userid":1,"username":"wwww","email":"mail@gg.com"}}


大概流程我也知道,就是写出的代码不行。刚接处这一块,请大师给我详细代码:(有注释更好-_-)


回复讨论(解决方案)

就是curl的POST吧,或者GET,你说的是这个意思么?

就是curl的POST吧,或者GET,你说的是这个意思么?
是这个意思

curl的post搜索引擎?便搜一大堆
?求到json之後用json_decode($?,true)就能??array,之後就?便你操作了.
????在哪??

不太明白你的意思

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn