Okay, I think I'm just being stupid here. Can someone please tell me why
this is wrong? Yeah I know it looks lame, but I'm just testing something.

This always returns "no matches"




$now = strtotime("now");
$out = "never set";
if ($now == ereg("[2200-2230]"))
        $out = "special";
elseif ($now == ereg("[0600-1159]"))
        $out = "morning";
elseif ($now == ereg("[1200-1659]"))
        $out = "afternoon";
elseif ($now == ereg("[1700-1959]"))
        $out = "evening";
elseif ($now == ereg("[2000-0000]"))
        $out = "night";
elseif ($now == ereg("[0001-0559]"))
        $out = "too late";
        $out = "no matches";

print(date("Hi", $now));
print "\n$out\n";


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to