if (array_key_exists('name', $user) and is_string($user['name']) and $user['name'] === '') { echo 'Имя пользователя не заполнено!'; }