我想从PHP中的URL请求信息

时间:2017-05-28 21:36:18

标签: arrays json ajax

信息如下:

[{"name":{"first":"Lola","last":"Ewing"},"salary":"47586.03","jobTitle":"Database Analyst"},{"name":{"first":"Durham","last":"Sharpe"},"salary":"67658.3","jobTitle":"Database Analyst"},{"name":{"first":"Hines","last":"Moore"},"salary":"39317.83","jobTitle":"Web Developer"}]

1 个答案:

答案 0 :(得分:0)

如果您正在从服务器处理它,请尝试:

$json=[{"name":{"first":"Lola","last":"Ewing"},"salary":"47586.03","jobTitle":"Database Analyst"},{"name":{"first":"Durham","last":"Sharpe"},"salary":"67658.3","jobTitle":"Database Analyst"},{"name":{"first":"Hines","last":"Moore"},"salary":"39317.83","jobTitle":"Web Developer"}]
$arr=json_decode($json);
echo arr['name']['first'];
// echo implode ( " " , arr['name'] ); output:  Hines Moore 

如果我理解你的问题,这就是你要找的东西