我如何从 json 对象获取此变量


How do I get at this variable from json object?

我有一个页面(insert.php),我试图从中将包含$my_variable作为json数组的响应返回到另一个页面(form.php)。

我可以在我的 firebug 控制台的响应部分看到这个数组,但我如何在表单上使用它.php并将其与 php 一起使用?

插入.php正在发送以下内容:

// sending output
header('Content-Type: text/json');
echo json_encode(array("my_var" => "$my_variable"));
}

只使用json_decode函数

$arr = json_decode($_REQUEST['my_var'],true);