php-rest-service icon indicating copy to clipboard operation
php-rest-service copied to clipboard

Read json input

Open ntvsx193 opened this issue 11 years ago • 1 comments

Hi! How about features for working php with AngularJS? AngularJS sends a request in json format. In php it is processed through php://input

function readInput(){
   $data = file_get_contents("php://input");
   $objData = json_decode($data, true);
   if (!empty($sData)) foreach($sData as $key => $value)
      $_POST[$key] = $value;
}

ntvsx193 avatar Jan 22 '14 18:01 ntvsx193

Well, how about my commit?

ntvsx193 avatar Aug 22 '14 09:08 ntvsx193