Jump to content

problem with date


felito

Recommended Posts

hi

 

how can i get only the years, and check them?

 

what i am trying:

$year = strtok($date, '-'); //problem here - only get the first year of array

$date = array ("1979-06-13", "2979-06-13");

foreach ($date as $key) {
if (2000 > $year) { 
echo ('true');
}
else 
echo ("error");
}

 

but i get true, true, so the second date is not working...

 

thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/240050-problem-with-date/
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.