Alexancho Posted June 27, 2010 Share Posted June 27, 2010 I do usual verification: if (isset($_POST['v_order']) && !empty($_POST['v_order'])) {} //Continue checkelse {die('Something wrong with the 'v_order'!); } When v_order=0 the line "die('Something wrong with the 'v_order'!);" is executed.If i change 0 to any other number, everything work correctly.I can avoid this case, but i don't understand why it is happened. Isn't zero a number? Link to comment Share on other sites More sharing options...
23.12.2012 Posted June 27, 2010 Share Posted June 27, 2010 0 is considered empty, according to the PHP manual. This is why it doesn't pass the check. Scrolling down in the link I've given, you'll find people who have implemented custom functions for correcting the... "issue" (but do remember that "it's not a bug. it's a feature"). Link to comment Share on other sites More sharing options...
Alexancho Posted June 27, 2010 Author Share Posted June 27, 2010 0 is considered empty, according to the PHP manual. This is why it doesn't pass the check. Scrolling down in the link I've given, you'll find people who have implemented custom functions for correcting the... "issue" (but do remember that "it's not a bug. it's a feature").I see. Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.