U
U
unlik2016-03-30 19:06:56
PHP
unlik, 2016-03-30 19:06:56

Find out the date the variable was modified?

There is a code that changes the value of a variable every 3 days.

<?php

$var = 10000;
$increment = 500;

$day = date('j');
$var += $increment * floor(($day-1)/3); 
echo $var;
?>

How can I find out and display the current date of change of this variable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-03-30
@unlik

Just write code that will update another variable (constant?) and update them at the same time.
Or by the time of the last modification of the file (if the write occurs only when the variable changes, and not with each access).
Actually, everything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question