Frage

I have a static variable defined in some file called lastitems.php.

lastitems.php gets called every 5 seconds by a javascript function update_items().

But because lastitems.php is totally another file, then the static variable is redefined every time the file gets opened.

Is there a way to avoid redefining (re-initiating) the variable?

War es hilfreich?

Lösung

lastitems.php

session_start();
$_SESSION['var'] = 'something';
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top