if(!empty($response[0])){
$result = $response[0];
}else{
if(!empty(json_decode($response)->error->error_code)) {
$result = array('error' => 'true');
}
}
if(!empty($response[0])){
$result = $response[0];
}else{
$result = $response;
if(!empty(json_decode($response)->error->error_code)) {
$result = array('error' => 'true');
}
}