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. Quote 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(); Quote Link to comment https://forums.phpfreaks.com/topic/104668-previous-date/#findComment-535732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.