I have many forms and was wondering wouldn't it be better to build a function that validates user entries? So for example we would forward the data into the function and it would return whatever and display a message with an error but i have no idea how to go about this since i am new to PHP. I don't even know if this is the best way to go about my problem.
Any tutorials or tips for validating lots of forms? Best practices?
BTW i have to avoid using external libraries. So creating simple code is the way forward.