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'; } ?> 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? 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() Link to comment https://forums.phpfreaks.com/topic/55476-solved-is_int/#findComment-274158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.