开发者

JQuery JSONP turn result into PHP array

开发者 https://www.devze.com 2023-04-02 12:06 出处:网络
I have been racking my small brain for ages now, so can this开发者_运维知识库 be done? if so how.I return a json array via jQuery Ajax request like this

I have been racking my small brain for ages now, so can this开发者_运维知识库 be done? if so how. I return a json array via jQuery Ajax request like this

dataType: 'jsonp', data: "somedata=this", jsonp: 'jsonp_callback', url: url,

I get the data OK like this (Where field is one key in the array) - I know it's there because it appends properly.

for (var key in data) { if (data.hasOwnProperty(key)) { jQuery('body').append(data[key]['Field']+'<br />'); } But can I convert the returned data to a PHP array? which is really what I want to do


OK decided to go a different route all together and use Curl

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号