pinkAngel pinkAngel - 2 years ago 99
PHP Question

get data from return value of mandrillapp array

Mandrill app return this :


I need to get only the value of "status". Something like this:
echo $result['status'];
How can I do it in PHP?

Answer Source

use json_decode() to get the status.. like this :


$str = '[{"email":"","status":"sent","_id":"234we4fvba4a3e8517d7a9","reject_reason":null}]';
$json = json_decode($str, true);
echo $json[0]['status'];

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download