我试图发送一个json数组到php post请求。是否有可能通过邮件发送json数组?
$myarray[] = 500;
$myarray[] = "hello world";
哪能$ myarray的JSON数据发送到一个PHP POST请求?
这里是我的尝试:
<form name="input" action="post.php">
<input type="hidden" name="json" value="[500,'hello world']" />
<input type="submit" value="Submit">
</form>
林测试API,被告知只需要JSON数据...但我似乎无法得到它的工作。我的猜测是我发送json数据错误。有什么想法吗?
JSON对象是文本。是的,你可以通过'post'发送文字。 – 2012-11-07 00:36:47
http://php.net/manual/en/function.json-decode.php – sachleen
@JackManey - [呃,实际上](http://tirania.org/blog/archive/2011/Feb-17.html )没有像JSON对象那样的东西。所有[是JSON字符串](http://benalman.com/news/2010/03/theres-no-such-thing-as-a-json/)。 –