How to access data in php transferred via webwrite?
3 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!