| |
| * Link führt ins Internet |
|

| |
Befehl | Version | Beschreibung | Inhalt der Datei statistik.csv | Beispiel | Ausgabe |
Befehl
| array file ( string $filename [, int $use_include_path] ) |
Version
Beschreibung
Mit file() kann man eine komplette Datei (filename) zeilenweise in ein Array
einlesen. Das Zeilenumbruchzeichen am Ende jeder Zeile wird als letztes Zeichen
n das entsprechende Array-Element übernommen.
Wird der optionale Parameter (use_include_path) auf 1 gesetzt, so wird auch
innerhalb des Include-Pfads (wird in der php.ini bestimmt) nach der Datei
gesucht.
Siehe auch:
• fopen()
• popen()
• readfile() |
Inhalt der Datei statistik.csv
01.08.2001#62.159.232.250#www.selfphp3.de
02.08.2001#212.82.34.222#www.selfphp4.de
02.08.2001#http://suchen.abacho.de#62.159.232.250
03.08.2001#http://www.fireball.de#212.185.44.15
|
Beispiel
<?PHP
$datei = 'statistik.csv';
$array = file ( $datei );
for ( $x = 0; $x < count ( $array ); $x++ )
{
echo $array[$x] . '<br>';
}
?>
|
Ausgabe
01.08.2001#62.159.232.250#www.selfphp3.de
02.08.2001#212.82.34.222#www.selfphp4.de
02.08.2001#http://suchen.abacho.de#62.159.232.250
03.08.2001#http://www.fireball.de#212.185.44.15
|
|
|
|
|
|
|


|