Monday, January 21, 2013

PHP Converting string to Date


  1. $dob1=trim($_POST['txt_dob']);//$dob1='dd/mm/yyyy' format
  2. list($d, $m, $y) = explode('/', $dob1);
  3. $mk=mktime(0, 0, 0, $m, $d, $y);
  4. $dob_disp1=strftime('%Y-%m-%d',$mk);
if you can convert string date to date formate direct using strtotime() function this not give valid date
i have all ready faced this problem
i hope this code will helpfull to you... :)

How to backup and download Database using PHP

< ?php $mysqlUserName = 'databaseusername' ; $mysqlPassword = 'databasepassword' ; $mysqlHostNa...