2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-10-27 14:52:50 +00:00
|
|
|
<!-- $Revision: 1.20 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.130 -->
|
|
|
|
<refentry id="function.file-get-contents">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>file_get_contents</refname>
|
|
|
|
<refpurpose>Reads entire file into a string</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>file_get_contents</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
2004-01-08 09:43:27 +00:00
|
|
|
<methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam>
|
2003-04-08 00:07:12 +00:00
|
|
|
<methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam>
|
2004-10-15 17:31:38 +00:00
|
|
|
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
|
2002-04-15 00:12:54 +00:00
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2003-01-06 23:42:51 +00:00
|
|
|
Identical to <function>file</function>, except that
|
2004-10-15 17:31:38 +00:00
|
|
|
<function>file_get_contents</function> returns the file in a string,
|
|
|
|
starting at the specified <parameter>offset</parameter>.
|
2004-01-16 19:29:09 +00:00
|
|
|
On failure, <function>file_get_contents</function> will return &false;.
|
2002-04-15 00:12:54 +00:00
|
|
|
</para>
|
2003-05-29 20:10:20 +00:00
|
|
|
<para>
|
|
|
|
<function>file_get_contents</function> is the preferred way to read the
|
|
|
|
contents of a file into a string. It will use memory mapping techniques if
|
2003-06-29 19:58:30 +00:00
|
|
|
supported by your OS to enhance performance.
|
2003-05-29 20:10:20 +00:00
|
|
|
</para>
|
2004-10-15 17:31:38 +00:00
|
|
|
<note>
|
|
|
|
<simpara>
|
|
|
|
The <parameter>offset</parameter> parameter was added in PHP 5.1.0.
|
|
|
|
</simpara>
|
|
|
|
</note>
|
2004-10-27 14:52:50 +00:00
|
|
|
<note>
|
2004-07-16 11:20:24 +00:00
|
|
|
<para>
|
2004-10-27 14:52:50 +00:00
|
|
|
If you're opening a URI with special characters, such as spaces, you
|
|
|
|
need to encode the URI with <function>urlencode</function>.
|
2004-07-16 11:20:24 +00:00
|
|
|
</para>
|
2004-10-27 14:52:50 +00:00
|
|
|
</note>
|
2002-04-15 00:12:54 +00:00
|
|
|
¬e.bin-safe;
|
|
|
|
&tip.fopen-wrapper;
|
2004-04-14 05:28:54 +00:00
|
|
|
¬e.context-support;
|
2004-02-19 16:06:56 +00:00
|
|
|
&warn.ssl-non-standard;
|
2002-04-23 22:10:15 +00:00
|
|
|
<simpara>
|
2004-05-18 14:23:19 +00:00
|
|
|
See also <function>fgets</function>, <function>file</function>,
|
2002-04-23 22:10:15 +00:00
|
|
|
<function>fread</function>, <function>include</function>,
|
|
|
|
and <function>readfile</function>.
|
|
|
|
</simpara>
|
2002-04-15 00:12:54 +00:00
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|