是否可以通过 AJAX 在另一个页面上创建 PHP 数组?这是我到目前为止所拥有的:
index.php
$.ajax({
url: 'array.php',
type: 'GET',
complete: function(data) {
$('#div').html(data.responseText);
}
});
array.php
$arr = array('red', 'blue', 'green');
echo $arr; //echo it?
如您所见,我正在尝试加载$arr
到 index.php 上的 div 中。这可能吗?