I\'m a beginner to PHP and I\'m writing some code to my site. I want to get the total number of sessions that is active at that instant. I knew this is some difficult task b
I am improving the answer from @user2067005. You actually need to deduct 2 from the count because scandir reports the . and .. entries as well.
scandir
.
..
$number_of_users = count(scandir(ini_get("session.save_path"))) - 2;