I have created a file called onlineusers.php that figures out how many users there currently are online. At the end of the script is a variable that captures the final number. I want to be able to use ONLY this variable in a separate file called members.php
How do I go about doing something like this?
using a variable from a separate file without using import
Moderator: General Moderators
Re: using a variable from a separate file without using impo
Move the code that calculates the number into a function in a separate file. Then have both scripts include the file and call the function.