<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Reference Book Blog &#187; fwrite</title>
	<atom:link href="http://www.phpreferencebook.com/tag/fwrite/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpreferencebook.com</link>
	<description>PHP Reference: Beginner to Intermediate PHP5</description>
	<lastBuildDate>Wed, 25 Aug 2010 12:58:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>fwrite() has a Double Tip that is Misplaced</title>
		<link>http://www.phpreferencebook.com/corrections/fwrite-double-tip-misplaced/</link>
		<comments>http://www.phpreferencebook.com/corrections/fwrite-double-tip-misplaced/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 12:00:09 +0000</pubDate>
		<dc:creator>Mario Lurig</dc:creator>
				<category><![CDATA[Corrections]]></category>
		<category><![CDATA[fread]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[fwrite]]></category>

		<guid isPermaLink="false">http://www.phpreferencebook.com/?p=346</guid>
		<description><![CDATA[On page 131, the fwrite() function has a TIP that reads: &#160; To read the entire file into a string, use the function filesize(). // file.txt contains the sentence: Hello World! $filename = 'file.txt'; $file = fopen&#40;$filename, 'r'&#41;; $string = fread&#40; $file, filesize&#40;$filename&#41; &#41;; var_dump&#40;$string&#41;; // file.txt now contains at the end: Hello World! You&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>On page 131, the fwrite() function has a TIP that reads:<br />
&nbsp;<br />
<strong>To read the entire file into a string, use the function filesize().</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// file.txt contains the sentence: Hello World!</span>
<span style="color: #000088;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'file.txt'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fread</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #990000;">filesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// file.txt now contains at the end: Hello World!</span></pre></div></div>

<p>You&#8217;ll notice that this is the same tip as fread() and doesn&#8217;t belong. It should be considered &#8216;removed&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpreferencebook.com/corrections/fwrite-double-tip-misplaced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
