Im creting a angular app that gets some data from a api available online, first i get the api information from my php script than in my angularjs app i go get the json result, but is giving me the error of "SyntaxError: Unexpected token t in JSON ", cant figure out why.
My php:
header('Content-Type: application/json');
// jSON URL which should be requested
$json_url = "http://iatageo.com/getLatLng/OPO";
// Initializing curl
$ch = curl_init( $json_url );
// Configuring curl options
// Getting results
$result = curl_exec($ch); // Getting jSON result string
echo json_encode($result);
Controller:
$http.get('iata.php').then(function(response){
$scope.originLatLong = response.data;
console.log($scope.originLatLong);
});