且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从JSON编码的数组字符串中获取值

更新时间:2021-09-18 06:05:20

更新我只是重新阅读您的问题,它看起来像就像你故意连接价值观一样。由于您使用 json_encode ,将值作为数组发送会更好,只需在JavaScript中访问它。

Update I just reread your question and it looks like you intentionally concatenated the values. Since you are using json_encode it would be much better to send the values as an array, and simply access it in JavaScript.

echo json_encode(array($PostedDate, $Places, $Company, $Designation, $ProjectDetails, $DesiredCandidate, $HRName, $HRContact, $Email));

然后在JavaScript中,他们会像这样访问:

Then in JavaScript they would be accessed like this:

alert(data[1]); // Would alert the value of $Places