PHP Reference Book Blog

PHP Reference: Beginner to Intermediate PHP5

Jul-21-08

Sprintf() Tip

posted by Mario Lurig

From the book:

For MySQL security, you can use sprintf() to force user input to have a maximum length and be valid for the structure of your database. Use the precision specifier to automatically parse the string submitted by GET or POST.