- json_decode: documentation ( source)
<?php
$reply_v = json_decode('{"ok":true,"image":"614410023999338.jpg"}', true);
if($reply_v['ok'] != 1 || $reply_v['image'] != "614410023999338.jpg") {
throw new Exception("Image upload failed: ".$reply);
}
echo "ok";