public function grep($needle) { $found = array(); foreach ($this->logs as $logEntry) { if (strpos($logEntry, $needle) !== FALSE) { $found[] = $logEntry; } } return $found; }