Can you control that when uploading a flat file, if one of the rows has characters such as: !@#$%&/(/()
, the system will perform some validation?
I am trying to update a record and I need to do the aforementioned validation. I was reading and I found the function preg_match
, I wanted to apply it in the following way and I did not it works:
$pattern = '/(["!@#$%&\/()]")/';
if (preg_match($pattern,$valor)) {
echo " se encontro caracteres especiales, validar plano ";
}
In the variable $valor
the field group promotion is loaded which is the one that I want to validate at the time of loading. I'm using PHP to do the form.
Why does the above code fail? How can i fix it? Is there any other way to validate?