How do I create a shared variable in PHP?
Posted: Mon Jul 14, 2003 5:14 am
I read some tutorials on variable in PHP, but none seem to talk about shared variable, variable that is shared among all clients....which is similar to the static variable found in JSP, where this variable is shared by all user.
No i dont want to use database, just wanna some way to create variable to hold some data to be shared by all users.
For example, I have a variable in php script:
$car=5;
$car++;
print($car);
If a user access this script, he will see the no.6 printed out. The next user access this script will see no. 7 and so on!!!!
No i dont want to use database, just wanna some way to create variable to hold some data to be shared by all users.
For example, I have a variable in php script:
$car=5;
$car++;
print($car);
If a user access this script, he will see the no.6 printed out. The next user access this script will see no. 7 and so on!!!!