How to apply preg_match on each element of an array
$array = [abc,def,ghi];
Right now i am doing this
foreach($array as $one_element){
if(!preg_match("/^[a-zA-Z0-9_. -]{1,23}$/",$one_element)){
die("One of element name is not valid");
}
}
Is there any easier and faster way to do this ?