Sunday, 1 February 2015

Date In Php

to get current date in php use B.I.F (Built in function) date ,Syntax for date date('format'):

<?php
//print date in year month and day format 
echo date('y-m-d');

//print output 15-02-01 current date
we can also use Year,Month & Date indivisualy
//print  day 
echo date('d');
//print  year 
echo date('y);
//print  month  
echo date('m');

?>

No comments: