Jump to content

[SOLVED] is_int


The Little Guy

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.