sandy1028 Posted May 8, 2008 Share Posted May 8, 2008 HI, How to return the previous date from the function function previousdate(){ date1=array(); $previous = mktime(0,0,0,date("m"),date("d")-1,date("Y")); $date1[]= date('Y-m-d', $previous); return $date1; } Here I am getting error as cannot use date. Link to comment https://forums.phpfreaks.com/topic/104668-previous-date/ Share on other sites More sharing options...
clearstatcache Posted May 8, 2008 Share Posted May 8, 2008 just a syntax error...forgot the $ sign in first line... date1=array(); ==> $date1 = array(); Link to comment https://forums.phpfreaks.com/topic/104668-previous-date/#findComment-535732 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.