faqts : Computers : Programming : Languages : PHP : Sample Code

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 6 people (67%) answered Yes
Recently 4 of 6 people (67%) answered Yes

Entry

can i use php to read the current date, if January, Send to jan.php..If Feb, send to feb.php, etc..

Sep 21st, 2005 02:48
Jad madi, John Marc, T M,


you would use the date function to get the month
$mon=strtolower(date('M'));
Then include the file you want like this:
include $mon.'.php';
This one should be more dynamic 
<?php
$month = strtolower(date('F'));
include("$month".".php");
?>