Saturday, 27 June 2015

Some PHP Code Snippets

Get Today date in PHP

$today = date("Y.m.d H:i:s");

Read Value PHP
 
<form action="welcome.php" method="get">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form> 

Welcome <?php echo $_GET["fname"]; ?>.<br />
You are <?php echo $_GET["age"]; ?> years old! 
 

php date +-
 
echo date('Y-m-d',strtotime('+1 d',strtotime('2009-07-08'))); 

 

0 comments:

Post a Comment