$ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://www.gesoco.com/pustimage/IMG_20170303_101923.jpg"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); $headers = array(); $headers[] = "X-Mashape-Key: rLXWlJeFbZmsh9UykZCXTJOEyAErp15eB7SjsnfoN6dmHWwkLj"; $headers[] = "Accept: application/json"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close ($ch); //echo $result; $ratul10= (json_decode($result, true)); $gender=$ratul10["face"][0]["attribute"]["gender"]["value"]; $glass=$ratul10["face"][0]["attribute"]["glass"]["value"]; echo $gender; echo $glass;