How to cut an array in php?

There is a need to prescribe all the elements of the array to an empty string. Is there some kind of universal shorthand
$errors['email'] = ";
$errors['family'] = ";
$errors['login'] = ";
$errors['email2'] = ";
$errors['family2'] = ";
$errors['login2'] = ";
$errors['email3'] = ";
$errors['family3'] = ";
$errors['login3'] = ";
March 20th 20 at 11:23
3 answers
March 20th 20 at 11:25
Solution
the cycle is called the well, or
$errors = array_fill_keys(array_keys($errors), ");
March 20th 20 at 11:27
Solution
foreach ($errors as $key=>$value){
$errors[$key]=";
}

sandbox.onlinephpfunctions.com/code/13d2c11ac97100...
March 20th 20 at 11:29
$errors = [
 'email' => ",
 'family' => ",
 'login' => ",
 'email2' => ",
 'family2' => ",
 'login2' => ",
 'email3' => ",
 'family3' => ",
 'login3' => "
];

Find more questions by tags PHP