Introduction
PHP is a very amazing language. It's strong enough (The biggest blog (WordPress) core language), it's broad enough (running on the biggest social networking site on Facebook), it's simple enough (as a beginner's preferred entry language). Works well on low-cost machines. And the PHP language has a lot of very good server suites (such as Wamp and Mamp), easy to install on your machine. PHP has a very rich library resource that makes it easy for developers to handle some business. Since we have the most contact with dates in the project, today we start with the date function.
To give a simple date example
I will use the echo command to output the content to our client (browser). I will use the following code as the base code.
- >
- < HTML lang="en">
- < Head >
- < Meta charset="utf-8" />
- < title > Getting started with dates in php5 title >
- Head >
- < Body >
- PHP
- Date_default_timezone_set (' Asia/shanghai ');
- echo "Today is", Date (' L ');
- ?>
- Body >
- HTML >
You will see the following content in your browser.
Today is Friday
This function outputs the text format of the day of the week. The date function requires at least one character parameter (this parameter tells us how to format the current date).
Try a different format
If you read the PHP manual,
http://www.bkjia.com/PHPjc/445660.html www.bkjia.com true http://www.bkjia.com/PHPjc/445660.html techarticle the introduction of PHP is a very surprising language. It's strong enough (The biggest blog (WordPress) core language), it's broad enough (running on the biggest social networking site on Facebook), it's full ...