Skip to content

Tag: validation

PHP function missing argument error

My validate function looks like that Function call example As you see, my validate function has 3 input vars. I’m not using second var – $data2 often, that’s why set it to 0 by default. But when I’m calling this function as given example (as far as I know it means $data=$lname, $data2=…

PHP using an array in a Validation Class

On my site I have my register page, where a user inputs his information to register to my site. When he does the I process the user inputted information. Now when processing it I’m using arrays to facilitate the process, and not have me write the same code over and over. For example, here is how I gathe…

Decimal validation + PHP?

How to do decimal number validation in PHP? (The decimal point is optional) it should accept … 0 , 1 , 2 , 0.123 , 0.2 , 12.34 etc. Answer Would any of these suit your needs? is_float() is_numeric()