Skip to content

Instantly share code, notes, and snippets.

@samayo
Created January 9, 2014 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samayo/8339642 to your computer and use it in GitHub Desktop.
Save samayo/8339642 to your computer and use it in GitHub Desktop.
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