Tag: line
JpGraph: Beispiel: LinePlot: Statistik des entstandenen Traffics

<?PHP function sBrowser($stext) { if (strpos($stext, "Googlebot") > 0) return (2); if (strpos($stext, "oogle-Sitemaps") > 0) return (2); if (strpos($stext, "Yahoo!") > 0) return (2); if (strpos($stext, "snbot") > 0) return (2); if (strpos($stext, "Safari") > 0) return (1); if (strpos($stext, "Firefox") > 0) return (1); if (strpos($stext, "MSIE") > 0) return (1); if (strpos($stext, "pera/") > 0) return (1); if (strpos($stext, "BonEcho") > 0) return (1); if (strpos($stext, "ozilla") > 0) return (1); return (NULL); } $Monat = "Nov/2008"; $lMonat = "Oct/2008"; $monate = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); $WochenTage =
JpGraph: Beispiel: LinePlot: Statistik der Besucher, die von google kamen

<?PHP $monate = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); foreach ($monate as $monat) $liste[$monat] = array(); /* * access_log wurde vorher mit * "grep '/2008:' access_log" auf das Jahr 2008 reduziert */ $handle = fopen("access_log", "r"); while (!feof($handle)) { $zeile = fgets($handle, 4096); $monat = explode("/", $zeile); $monat = $monat[1]; if ($p = (strstr($zeile, "google"))) { if ($p = (strstr($p, "?"))) { $p = substr($p, 1); if ($q = explode("&", $p)) { foreach ($q as $t) { if (substr($t, 0, 2) == "q=") { $t2 = explode("\"", $t); $liste[$monat][] = ($t2[0]) ? $t2[0]