I have a PHP script that's being called through jQuery AJAX.(我有一个PHP脚本,通过jQuery AJAX调用。)
I want the PHP script to return the data in JSON format to the javascript.(我希望PHP脚本将JSON格式的数据返回给javascript。) Here's the pseudo code in the PHP script:(这是PHP脚本中的伪代码:)
$json = "{";
foreach($result as $addr)
{
foreach($addr as $line)
{
$json .= $line . "
";
}
$json .= "
";
}
$json .= "}";
Basically, I need the results of the two for loops to be inserted in $json.(基本上,我需要在$ json中插入两个for循环的结果。)
ask by AquinasTub translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…