Indeed, this library of filters also permits you to perform powerful validation on variables in a pretty straightforward fashion, without the need to define custom and complex functions. So, if you’re interested in learning how to use these filters within your own web applications, then this group of articles might be the material that you’re looking for. Logically, if you already had the chance to read the introductory installment of this series, then at this point you’ll have a fairly clear idea of how to use the filter extension for validating integers. In that specific tutorial I coded a few basic examples that demonstrated how to carry out this task by using the FILTER_VALIDATE_INT filter in conjunction with the “filter_var()” function. Not only did this filter allow us to check whether a given value was an integer or not, but it permitted us to determine if the value in question was within a specified range. This extra functionality was implemented via an additional “option” array, which was passed to the aforementioned “filter_var()” function. However, I’m only scratching the surface when it comes to exploring the numerous capabilities offered by the filter extension. Therefore, in this second chapter of this series, I’m going to discuss how to use the FILTER_VALIDATE_INT filter that you learned in the previous part, this time for validating array elements as well as octal and hexadecimal integers. Does this sound complex to you? It won’t be at all, trust me. Now, let’s get rid of the preliminaries and continue exploring the useful validation capacities of the filter PHP 5 extension!
blog comments powered by Disqus |