Hi is there a specific way to check for preg_match.
Only reason i ask is im having trouble even matching basics.
I have a validation script with a function like this(for example...simpl ified for testing)
then i call it from a sepperate file such as
But i always get an error...even when my value is just abc.
what am i doing wrong here...have got a feeling im gonna feel stupid afterwards but please someone tell me what's going wrong.
Only reason i ask is im having trouble even matching basics.
I have a validation script with a function like this(for example...simpl ified for testing)
Code:
function AlphaNumeric($value){
if(preg_match("/^a-z/", $value)){
return true;
}
}
Code:
if(!$validation->AlphaNumeric($value){
give error message...
}
what am i doing wrong here...have got a feeling im gonna feel stupid afterwards but please someone tell me what's going wrong.
Comment