[Solved] Angularjs :- how to get funtion’s response using $http.get()?

In cust.php you actually need to call the function as well <?php header(‘Content-Type: application/json’); function testdata(){ $str=”{“employees”:[{“firstName”:”John”, “lastName”:”Doe”},{“firstName”:”Anna”, “lastName”:”Smith”},{“firstName”:”Peter”, “lastName”:”Jones”}]}”; return $str; } echo testdata(); ?> EDIT: I’ve had to change your $str as well, single quote surrounding keys and values are not valid, I have changed it to double quotes ” which are valid. … Read more