Wie kriege ich den Pfad (zB: http://www.meinedomain.ch/folder1/) ohne Dateinamen (zB: index.php) heraus?
Kann mir jemand helfen?
Danke
	
Beispiel Datei (mc.txt) - (original ca. 400 zeilen):
313|http://www.meinedomain.ch/folder1/index.php|
754|http://www.meinedomain.ch/folder3/xx1.php|
234|http://www.meinedomain.ch/folder59/nonono.php|
532|http://www.meinedomain.ch/folder99/blabla.php|4242
usw....
					Kann mir jemand helfen?
Danke
PHP-Code:
	
	
$dbfile = "mc.txt"; #Absoluter Pfad zur Datenbankdatei
$url2script = "meinedatei.php"; #Bitte anpassen - pfad counter.php
global $dbfile, $url2script;
$datei = fopen($dbfile, "r");
$text = "<table width=\"30%\"><tr>";
while($zeile = fgetcsv($datei, 1000, "|")):
   $zahl[$zeile[0]] = $zeile[2];
   $url[$zeile[0]] = $zeile[1];
endwhile;
arsort($zahl);
$i='0';
foreach($zahl as $var)
{
   if($i=='10') break;
      
   echo "<a href=\"$url2script?id=" . key($zahl) . "\" target=\"_blank\">" . key($zahl) . "</a> Zugriffe: $var<br>";
   next($zahl);
   $i++;
  
   } 
313|http://www.meinedomain.ch/folder1/index.php|
754|http://www.meinedomain.ch/folder3/xx1.php|
234|http://www.meinedomain.ch/folder59/nonono.php|
532|http://www.meinedomain.ch/folder99/blabla.php|4242
usw....
 
          

Kommentar