I'm asking for your help because I would like to automate something in my form processing in PHP.
My goal is to know the HTML type of a $_POST variable.
For example, if it is a <input type="number" name="tata">, in my PHP processing, I would like to transform the content as (int) $_POST['tata'] and make some verification.
The final goal is to be able to use one verification for all my fields and all my forms on my website to convert the variables as the good format I'm waiting before sending data to my database.
Is there any way to do this in PHP ? I know that I can get the type with jQuery but I would like to avoid this method.
Thank you for your answers
gettypemight be of interest to get you startedtype="number"only integer will allowed, you can also useis_numeric($_POST['tata'])to check if the value is a number or not"1337"came from atype="number"ortype="text"-field. What you can do is to add hidden fields with the input types for each normal input field