Handling empty $_POST

Once again, I am humbled by your knowledge!

Thanks for the new trick - Mr. Always-Sanitizes-My-Data totally missed the is_array( ) angle!!

:thumbsup:

Well I suppose each will have their view. As empty() doesn’t throw a index error (because ‘interest’ isn’t set) and is very generic in nature I can see how some would rather use it. It’s kind of like saying, OK I’m here at Sitepoint and because my post isn’t empty it must be good but with isset I would be checking that I am making a post to the php forum. I prefer to check for a specific KEY, especially when I intend to loop through this array KEY. To each his own.

Yeah didn’t read the question and filter_var should be used inside the tennary.

For arrays why not use : filter_input_array() ?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.