Вопрос

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?

Это было полезно?

Решение

lastitems.php

session_start();
$_SESSION['var'] = 'something';
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top