Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions reference/filesystem/functions/file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}

// Another example, let's get a web page into a string. See also file_get_contents().
$html = implode('', file('http://www.example.com/'));

// Using the optional flags parameter since PHP 5
$trimmed = file('somefile.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
?>
Expand All @@ -158,11 +155,11 @@ $trimmed = file('somefile.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
&reftitle.seealso;
<para>
<simplelist>
<member><function>file_get_contents</function></member>
<member><function>readfile</function></member>
<member><function>fopen</function></member>
<member><function>fsockopen</function></member>
<member><function>popen</function></member>
<member><function>file_get_contents</function></member>
<member><function>include</function></member>
<member><function>stream_context_create</function></member>
</simplelist>
Expand Down
4 changes: 2 additions & 2 deletions reference/xml/functions/xml-parse-into-struct.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Array
Event-driven parsing (based on the expat library) can get
complicated when you have an XML document that is complex.
This function does not produce a DOM style object, but it
generates structures amenable of being transversed in a tree
generates structures amenable of being traversed in a tree
fashion. Thus, we can create objects representing the data
in the XML file easily. Let's consider the following XML file
representing a small database of aminoacids information:
Expand Down Expand Up @@ -224,7 +224,7 @@ class AminoAcid {
function readDatabase($filename)
{
// read the XML database of aminoacids
$data = implode("", file($filename));
$data = file_get_contents($filename);
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
Expand Down
6 changes: 2 additions & 4 deletions reference/zlib/functions/gzencode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@
<programlisting role="php">
<![CDATA[
<?php
$data = implode("", file("bigfile.txt"));
$data = file_get_contents("bigfile.txt");
$gzdata = gzencode($data, 9);
$fp = fopen("bigfile.txt.gz", "w");
fwrite($fp, $gzdata);
fclose($fp);
file_put_contents("bigfile.txt.gz", $gzdata);
?>
]]>
</programlisting>
Expand Down