PHP Date Function with Example


 

PHP Date Function with Example

PHP Date Example: In this tutorial you will get to know about how to write a program in PHP, in addition this page has given important links, which will help you to learn PHP

PHP Date Example: In this tutorial you will get to know about how to write a program in PHP, in addition this page has given important links, which will help you to learn PHP

 Write simple program to display the current date

To develop the first program of PHP, you need to have a web server like: Apache Tomcat , IIS etc. Another way to develop PHP program. WAMP is a kind of stack of software collection, WAMP is the acronym for Windows, Apache, MySQL, and PHP. WAMP server is one of the popular server use for PHP. It is free and you can download it from http://www.wampserver.com/en/download.php (you can copy and paste this link in the browsers address bar). After downloading the .exe file, install this file (normal installation as we do for other software package),

For downloading and installing please visit our web site:http://roseindia.net/tutorial/php/phpbasics/Downloading-Installing-Wamp.html

For starting the WAMP server: http://roseindia.net/tutorial/php/phpbasics/Running-Testing-Wamp.html

Now to develop the first program do as follows:

Exmaple 1:

<?php

    echo date("l");

?>

Output:

Tuesday

In PHP date() is a predefined function which returns a string value, depends on the parameter passed. To know more about date() function please visit our web page: http://www.roseindia.net/tutorial/php/phpdate/index.html

Ads