Php 我正在尝试在angularjs文件中获取select查询响应
我想向angularjs文件发送Select查询响应Php 我正在尝试在angularjs文件中获取select查询响应,php,postgresql,Php,Postgresql,我想向angularjs文件发送Select查询响应 Php file header('Content-Type: application/json'); echo json_encode(pg_fetch_row($res)); angularjs file $http({ method: 'GET', url: 'getData.php' }).then(function successCallback(response) {
Php file
header('Content-Type: application/json');
echo json_encode(pg_fetch_row($res));
angularjs file
$http({
method: 'GET',
url: 'getData.php'
}).then(function successCallback(response) {
console.log(response);
$scope.products= response.data;
}, function errorCallback(response) {
console.log(response);
});
响应是这对象{data:“↵ ", 状态:200,配置:对象,状态文本:“确定”,标题:函数}
如何获取“数据”。此符号是什么↵ “?是否有php端的错误消息?是否确定在标题前没有输出任何内容,甚至没有空格或换行符?是否有php端的错误消息?是否确定在标题前没有输出任何内容,甚至没有空格或换行符?