How to access data in php transferred via webwrite?

2 views (last 30 days)
Hey everyone,
I am using webwrite to parse some data to a php script like so:
data = struct('userId', 'testuser','Password', 1234);
url = 'http://example.info/php/test.php';
options = weboptions('MediaType', 'application/json');
response = webwrite(url, data, options);
I want to access the data originally stored in the struct in my php script, but don't know how I can refer to the parsed data in the php script (is it similar to using "GET" and "POST" when using URL-encoded data?)
To start with, I'd simply like to display the transferred data with php like so:
$data = json_decode($data,true);
echo '<pre>' . print_r($json, true) . '</pre>';
As mentioned above, my problem is how I can get the now json-encoded struct element sent by Matlab into the php variable "$data".
Thanks in advance!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!