Laravel variable validation regex pattern not working. Help me please
$variable = "(222) 111-2233";
$fileArray = array('variable' => $variable);
$rules = array('variable' => 'regex:/([(])([0-9])([0-9])([0-9])([)]) ([0-9])([0-9])([0-9])-([0-9])([0-9])([0-9])([0-9])/');
$validator = Validator::make($fileArray, $rules);
if ($validator->fails()){ echo 'fail'; } else { echo 'yes'; }
Return fail :(
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire