PHP头条
热点:

js传送字符串数组到php


js传递字符串数组到php
为什么从js传递的字符串数组在php中变成了一个字符串,ajax传递的,代码如下:
js端:
var selected = new Array('1','2');
JSON.stringify(selected);
post....

php端:
$selected = json_decode($_POST['selected']);
这样写$selected是空的 
$selected = $_POST['selected'];
这样的话$selected便是一个字符串,我要的是数组。

求助各位了,折腾好久了。。。 js php 分享到: 更多

相关文章

相关频道:

PHP之友评论

今天推荐