Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > ebb1914cf182a88528b4547490db1dd8 > files > 652

kdewebdev-quanta-doc-3.5.9-2mdv2008.1.x86_64.rpm

<HTML
><HEAD
><TITLE
>file</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="manual.html"><LINK
REL="UP"
TITLE="Filesystem functions"
HREF="ref.filesystem.html"><LINK
REL="PREVIOUS"
TITLE="fgetss"
HREF="function.fgetss.html"><LINK
REL="NEXT"
TITLE="file_exists"
HREF="function.file-exists.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.fgetss.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.file-exists.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.file"
>file</A
></H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN8566"
></A
>file -- read entire file into an array</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN8569"
></A
><H2
>Description</H2
><DIV
CLASS="funcsynopsis"
><P
></P
><CODE
CLASS="FUNCDEF"
>array file</CODE
>(string filename, int 
      [<SPAN
CLASS="optional"
>use_include_path</SPAN
>]
     );<P
></P
></DIV
><P
> 
     Identical to <A
HREF="function.readfile.html"
><B
CLASS="function"
>readfile()</B
></A
>, except that
     <B
CLASS="function"
>file()</B
> returns the file in an array. Each
     element of the array corresponds to a line in the file, with the
     newline still attached.
    </P
><P
>&#13;     You can use the optional second parameter and set it to "1", if
     you want to search for the file in the <A
HREF="configuration.html#ini.include-path"
>include_path</A
>, too.
    </P
><P
>&#13;     <DIV
CLASS="informalexample"
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>  1&nbsp;
  2&nbsp;&#60;?php
  3&nbsp;// get a web page into an array and print it out
  4&nbsp;$fcontents = file( 'http://www.php.net' );
  5&nbsp;while ( list( $line_num, $line ) = each( $fcontents ) ) {
  6&nbsp;   echo "&#60;b&#62;Line $line_num:&#60;/b&#62; " . htmlspecialchars( $line ) . "&#60;br&#62;\n";
  7&nbsp;}
  8&nbsp;
  9&nbsp;// get a web page into a string
 10&nbsp;$fcontents = join( '', file( 'http://www.php.net' ) );
 11&nbsp;?&#62;
 12&nbsp;      </PRE
></TD
></TR
></TABLE
><P
></P
></DIV
>
    </P
><P
> 
     See also <A
HREF="function.readfile.html"
><B
CLASS="function"
>readfile()</B
></A
>,
     <A
HREF="function.fopen.html"
><B
CLASS="function"
>fopen()</B
></A
>, and <A
HREF="function.popen.html"
><B
CLASS="function"
>popen()</B
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.fgetss.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="manual.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.file-exists.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>fgetss</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.filesystem.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>file_exists</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>