Join Up!
104884 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousfile_get_contentsfileatimenext
Last updated: Sun, 27 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Finnish | German | Spanish

file

(PHP 3, PHP 4 )

file -- Načte celý soubor do pole

Popis

array file ( string filename [, int use_include_path])

Identické s readfile(), soubor je však vrácen v podobě pole. Každý element pole odpovídá jednomu řádku v souboru včetně znaku konce řádku.

Můžete použít nepovinný druhý parametr a nastavit ho na "1", pokud chcete hledat soubor také v include_path.

<?php
// načti WWW stránku do pole a vytiskni ji
$fcontents = file ('http://www.php.net');
while (list ($line_num, $line) = each ($fcontents)) {
    echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n";
}

// načti WWW stránku do řetězce
$fcontents = join ('', file ('http://www.php.net'));
?>

Viz také readfile(), fopen(), fsockopen(), a popen().

User Contributed Notes
file
add a note about notes
There are no user contributed notes for this page.
previousfile_get_contentsfileatimenext
Last updated: Sun, 27 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST