HOME
PHP
Introduction Php Installation
PHP Basic Scripts
PHP variables
PHP operators
PHP Conditional statement
PHP functions
PHP Arrays
PHP Objects & classes
PHP with Forms
PHP Files
PHP With Database
PHP session
PHP cookies
PHP Regular Expressions
PHP Server Environment
PHP Graphics
PHP Advance
|
PHP Advance
The PHP Date() Function
The PHP date() function formats a timestamp to a more readable date and time
The first parameter in the date() function specifies how to format the date/time. It uses letters to represent date and time formats. Here are some of the letters that can be used:
d - The day of the month
m - The current month, as a number
Y - The current year in four digits
The output of the code above could be something like this:
2006/07/15
2006.07.15
include() function
The include() function takes all the text in a specified file and copies it into the file that uses the include function.
Example 1
Assume that you have a standard header file, called "test.php". To include the test file in a test1.php page, use the include() function, like this:
test1.php
now the test.php looks like this
now the output looks like this
Do you want to become web designer then Welcome to webschools
The PHP mail() Function
The PHP mail() function is used to send emails from inside a script.
In the example below we first declare the variables ($to, $subject, $message, $from, $headers),
then we use the variables in the mail() function to send an e-mail:
|
|
|
|