All pastes #402227 Raw Edit

Mine

public text v1 · immutable
·published 2007-03-19 20:10 UTC
rendered paste body
<?
error_reporting(E_ALL);
class getLog {
        private $wholeLog = array();
        private $secondaryWholeLog = array();
        public function __construct($url) {
                $fp = fopen($url,"rb");
                $file = stream_get_contents($fp);
                fclose($fp);
                $regex = "/^#(.*)$/";
                $rep = "";
                echo ereg_replace($regex,$rep,$file);
        /*      $this->wholeLog = $this->cleanLog(file($url)); // pega o arquivo de log e o limpa

                echo '<b>' .count($this->wholeLog). '</b> total conectados.<br><br>';

                        for($i = 0; $i < count($this->wholeLog); $i++) {

                        $this->secondaryWholeLog[$i] = explode(" ",$this->wholeLog[$i]);

        //              $countSecondaryWholeLog = count($this->secondaryWholeLog);
         */
                }
        //      print_r($this->secondaryWholeLog);
        //}
        public function showUsers() {
                foreach($this->secondaryWholeLog as $key => $value) {
                echo 'usuário numero: <b>' . $key;
                echo '</b><br><br>';
                echo $key . ' => ' . $value;
        }
        }

        public function cleanLog($logFileArray) {
                for($i = 0; $i <= 9; $i++) { //workaround temporario pra limpar campos desnecessarios
                unset($logFileArray[$i]);
                }
                return $logFileArray;
        }

}
$a = new getLog("http://floripa.sistemaplug.com/WMSMonitor/logtest.txt");
?>