Here, how you can display total number of online user in your webpage you want. Just include file name, which I have given file name as online-user.php here. You need to include this file on any php page you want to display total users online.
I have developed this php script to implement on my own webpage.
See this, I have implement this on https://www.ashesh.com.np/nepali-date-converter.php
online-user.php
$file1 = 'online-user-ashesh/ip.txt';
$lines = file($file1);
$line2 = "";
foreach ($lines as $line_num => $line)
{
//echo $line."
";
$fp = strpos($line,'****');
$nam = substr($line,0,$fp);
$sp = strpos($line,'++++');
$val = substr($line,$fp+4,$sp-($fp+4));
$diff = $sd-$val;
if($diff ";
echo "";
//echo "A ";
echo "";
echo "Total users online $count
";
echo " ";
?>
And you need to create empty text file called ip.txt as described in online-user.php code.
You can download here too