php - how to save date for the second run of my application -


here did:

$time1 = date('h:i'); $time2 = null; $time_array = array($time1, $time2); 

$time1 current time. every time run script, shows moment.

i explain want do:

at t=0 (initial) (first time run code) 

$time1 = 10:14:26; (the date value want saved use of second run of code)

i think want use session variables. remember, if user has cookies or private browsing enabled not work.

session_start();  if (isset($_session['time_1'])) {     $time2 = $_session['time_1']; } $_session['time_1'] = date('h:i');  $time_array = array($_session['time_1'], $time2); 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -