answersLogoWhite

0


Best Answer
Here is the code



$variable_date = '4/22/2013'; // Just add your string variable here
$date_to_check = date('m/d/Y', strtotime($variable_date));
$current_date = date('m/d/Y');
echo "Current Date is ".$current_date."
";
echo "Date to check is ".$date_to_check;



?>
User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you compare current date to date in php?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you change the current directory in PHP?

chdir() PHP function helps in changing the current directory.


Insert date on web page?

Using PHP: <?php echo date("d/m/y"); ?>


How do you echo date plus php?

Your question isn't quite clear but I think you mean this: <?php echo date("m-d-Y"); ?>


What is your current role in company?

My current role is as a senior web developer in php


How do you get the current working directory in PHP?

$curr_dir = getcwd();


What is PHP-Nuke anyway?

PHP-Nuke is a PHP- and MySQL-based content management system written by Francisco Burzi. The current stable release is 8.3.2.


What is gm date in php?

Gm date is used to return date and time in UTC/GMT format.


What is the old version php?

Any version released before the current stable release is considered an old version of PHP.


How do you get the day of the week with php?

Following code will give you current day of the week (monday, Tuesday and so on):$day = date ('l', time());If you want more information on this topic, you can search php.net for function "date()" which formats timestamp in a way you want and "time()" which returns current timestamp.


What is the current value of USD to PHP?

1 U.S. dollar = 43.8000964 Philippine pesoshttp://www.google.nl/search?q=1+USD+to+PHP


Which one is easy to learn PHP or QA testing?

You are trying to compare two things that are completely different. PHP is a programming language, and QA testing is a step in the creation of products.


How can you check whether your PHP installation has got IMAP support?

It's probably in the php.ini file, you can also have a look at the current configuration of your PHP by running a file on the webserver with the following code: <?php phpinfo(); ?> goodluck