I am using the webwrite function in Matlab R2015b to pass on some structured information as a json media type into a PHP script on my server. The matlab code runs without error, however I do not know how to access the information in the PHP script to work with it and first of all to check if the data was transmitted correctly.
Here is a simple example of my Matlab code:
data = struct('userId', 20 ,'Password', 10);
url = 'http://example.info/php/test.php';
options = weboptions('MediaType', 'application/json');
response = webwrite(url, data, options);
Now i tried several things in PHP most of them included some usage of the php command json_decode like:
$data = json_decode($data,true);
However, I do not know how Matlab passes on the information and how to properly access it.
Many thanks for any hints.