Массив всегда пуст, даже если ожидается, что он будет содержать элементы.Php

Кемеровские программисты php общаются здесь
Anonymous
Массив всегда пуст, даже если ожидается, что он будет содержать элементы.

Сообщение Anonymous »

Есть идеи, почему это не выводит ошибки?
// Validate the email
if (preg_match($regex, $email))
$errors[] = "Invalid email address";

// ... and the password
if (strlen($password) < 4)
$errors[] = "Password is too short";

// No errors?
if (empty($errors))
{
// insert into db
}

// If there were any errors, show them
if (!empty($errors))
{
$errors = array();
foreach ($errors as $error)
echo '[*]' . $error . '';
}


Подробнее здесь: https://stackoverflow.com/questions/239 ... e-elements

Вернуться в «Php»