Created
January 9, 2014 18:46
-
-
Save samayo/8339642 to your computer and use it in GitHub Desktop.
testing visithor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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