if(empty($errors)){
$json = json_encode([
'type' => 'success',
'message' => 'Successfull'
], JSON_UNESCAPED_UNICODE);
}else{
$json = json_encode([
'type' => 'error',
'messege' => $errors[],
], JSON_UNESCAPED_UNICODE);
}
echo $json;