Skip to content

Instantly share code, notes, and snippets.

@samayo
Created Jan 9, 2014
Embed
What would you like to do?
testing visithor
<?php
class VisiThorGraph{
function __construct($myFile){
$this->myFile = new SplFileObject($myFile);
}
function getTotalCount(){
$count = null;
while(!$this->myFile->eof()){
$explode = explode('#', str_replace("\n", "", $this->myFile->fgets()));
if(!empty($explode[1])){
$count += $explode[1];
}
}
return $count;
}
function getGraphResult(){
while(!$this->myFile->eof()){
$explode = explode('#', str_replace("\n", "", $this->myFile->fgets()));
if(!empty($explode[1])){
$height = $explode[1];
echo "<div class='graph_bar'><span style='height:{$height};'>{$explode[1]}<span></div> \n";
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment