<?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 Tutorials Code Snippets and Php Tips &#187; file handle</title>
	<atom:link href="http://readytousesolutions.com/phpblog/tag/file-handle/feed/" rel="self" type="application/rss+xml" />
	<link>http://readytousesolutions.com/phpblog</link>
	<description>PHP tutorials - Examples of the most useful scripts</description>
	<lastBuildDate>Thu, 23 Sep 2010 06:54:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP Tutorial : Write to a file with fwrite</title>
		<link>http://readytousesolutions.com/phpblog/php-tutorial-write-to-a-file-with-fwrite/</link>
		<comments>http://readytousesolutions.com/phpblog/php-tutorial-write-to-a-file-with-fwrite/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 05:22:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basic PHP]]></category>
		<category><![CDATA[file handle]]></category>
		<category><![CDATA[fwrite]]></category>
		<category><![CDATA[php file handle]]></category>
		<category><![CDATA[php fwrite]]></category>
		<category><![CDATA[php write to a file]]></category>

		<guid isPermaLink="false">http://www.crivionweb.com/phpblog/?p=257</guid>
		<description><![CDATA[I showed you earlier in a older post how to open and read text contents from a file. Now it&#8217;s time to see how to write to a file using php function called fwrite(). &#60;?php $theFileToWriteTo = "textFile.txt"; $fileHandle = &#8230; <a href="http://readytousesolutions.com/phpblog/php-tutorial-write-to-a-file-with-fwrite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I showed you earlier in a older post how to open and read text contents from a file. Now it&#8217;s time to see how to write to a file using php function called fwrite().</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
$theFileToWriteTo <span class="phpOperator">=</span> <span class="phpString">"textFile.txt"</span><span class="phpText">;</span>
$fileHandle <span class="phpOperator">=</span> <span class="phpFunction">fopen</span><span class="phpOperator">(</span>$theFileToWriteTo, <span class="phpString">'w'</span><span class="phpOperator">)</span><span class="htmlText"> or </span><span class="phpFunction">die</span><span class="phpOperator">(</span><span class="phpString">"cannot open the text file"</span><span class="phpOperator">)</span><span class="phpText">;</span>
$textToWrite <span class="phpOperator">=</span> <span class="phpString">"First text to write here\n"</span><span class="phpText">;</span>
<span class="phpFunction">fwrite</span><span class="phpOperator">(</span>$fileHandle, $textToWrite<span class="phpOperator">)</span><span class="phpText">;</span>
$textToWrite <span class="phpOperator">=</span> <span class="phpString">"Second line to write here\n"</span><span class="phpText">;</span>
<span class="phpFunction">fwrite</span><span class="phpOperator">(</span>$fileHandle, $textToWrite<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">fclose</span><span class="phpOperator">(</span>$fileHandle<span class="phpOperator">)</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>Note that &#8220;\n&#8221; means new line!</p>
]]></content:encoded>
			<wfw:commentRss>http://readytousesolutions.com/phpblog/php-tutorial-write-to-a-file-with-fwrite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

