PHP Classes

Data validation enhancement request

Recommend this page to a friend!

      PHP Form Data Validation  >  All threads  >  Data validation enhancement request  >  (Un) Subscribe thread alerts  
Subject:Data validation enhancement request
Summary:It would be nice if..
Messages:3
Author:william drescher
Date:2018-10-15 11:59:32
 

  1. Data validation enhancement request   Reply   Report abuse  
Picture of william drescher william drescher - 2018-10-15 11:59:32
It would be nice if one of the validation options would check to see if the data entered matched a string of characters with a defined separator, eg:
data: wow
match: string: alpha, "toy dog", wow
where the comma is a the given separator (which should be passed as a variable)

It would be nice if one of the validation options would check to see if the data was included in the match string, eg:
data: wow
match: alpha toy wowzer dog
(the spaces are used for clarity and would be ignored unless the data was a space) This would vlaidate because wow is included in wowzer.

  2. Re: Data validation enhancement request   Reply   Report abuse  
Picture of Mark Mendoza Mark Mendoza - 2018-10-15 14:03:41 - In reply to message 1 from william drescher
hi thanks for the good idea. I updated the file and added two new rules

public static function regex($val,$regex){
return preg_match($regex,$val);
}

public static function match($val,$param){
return $val == $param;
}

Ive also changed the accessibility of $error property.

Please feel free to edit the file when you need to.

  3. Re: Data validation enhancement request   Reply   Report abuse  
Picture of william drescher william drescher - 2018-10-16 10:31:13 - In reply to message 2 from Mark Mendoza
That is what I call excellect! support.
bill