I'm using angularjs, now I want get a php session variable, so I've create a php file called session.php and inside have this content:
$_SESSION['phone'] = '55551864';
return json_encode($_SESSION['phone']);
from angularj, I've this request:
$http({
method: 'GET',
url: 'session.php'
}).then(function successCallback(response)
{
var phone_number = JSON.stringify(response);
alert(phone_number);
}, function errorCallback(response) {
alert("error happean!");
});
the alert display this content:
{"data":"","status":200,"config":{"method":"GET","transormRequest":[null],"transoformResponse":[null],"url":"session.php","headers":{}},"statusText":"OK"}
I just want return 55551864 what happean?