In this example, we lean how to get real time active users in mobile app or web application using nodejs socket.io.
Sometime, we require to make functionality to get real time online users counter on your admin panel. We can easily do it using node js and socket io. I give you very simple example for real time online users counter that way you can simply use in your PHP project or any other language project. I created two files for this example as listed bellow:
First file is index.html, in this file we can run on browser and see .....
If you are working on code php and you require to count number of files, images, zip file, rar files, etc in the given folder path, then you can count using glob() and count() of php. So, let's see this bellow example and learn how it done.
<pre class="prettyprint lang-php">
$folderPath = "upload/";
$countFile = 0;
$totalFiles = glob($folderPath . "*");
$countFile = count($totalFiles);