Когда я пытался получить код со страницы PHP с помощью jQuery Ajax, я обнаружил странную ошибку: «Неопределенная переменная: ошибки»
<?php
$errors = array("already_signed" => "You are already signed in", "field_empty" => "All fields must be filled", "long_username" => "Username length must be less then 40 symbols", "incorrect_email" => "Your mail is incorrent", "user_exists" => "User with such username already exists", "account_not_found" => "Account not found", "passwords_arent_same" => "Passwords must be the same");
Function check_post() {
$answer = array("ok" => "false", "answer" => $errors["field_empty"]);
echo json_encode($answer);
}
check_post();
?>
Если я выведу эхо без функции - все будетХорошо.Спасибо за любую помощь