The Little Guy Posted June 13, 2007 Share Posted June 13, 2007 Why does the is_int functions not work? If $m, $d, $y contains a letter, Invalid Date is echoed out. If $m, $d, $y doesn't contain a letter, Invalid Date is echoed out. <?php list($m,$d,$y) = explode("/",$_GET['date']); if(strlen($m)<2||strlen($m)>2||strlen($d)<2||strlen($d)>2||strlen($y)<4||strlen($y)>4||_int($m)||!is_int($d)||!is_int($y)){ echo 'Invalid Date'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/55476-solved-is_int/ Share on other sites More sharing options...
Link Posted June 13, 2007 Share Posted June 13, 2007 Are leading zeros lost? Quote Link to comment https://forums.phpfreaks.com/topic/55476-solved-is_int/#findComment-274157 Share on other sites More sharing options...
The Little Guy Posted June 13, 2007 Author Share Posted June 13, 2007 Sorry I was using the wrong function I needed is_numeric() Quote Link to comment https://forums.phpfreaks.com/topic/55476-solved-is_int/#findComment-274158 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.