<?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>Tutorial for feof () in Reading file Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/tutorial-for-feof-in-reading-file/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/tutorial-for-feof-in-reading-file/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Mon, 16 Aug 2021 13:18:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Tutorial for feof () in Reading file</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-feof-in-reading-file/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-feof-in-reading-file/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Mon, 16 Aug 2021 13:18:55 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[feof ()]]></category>
		<category><![CDATA[feof () in Reading file]]></category>
		<category><![CDATA[feof () in Reading file in php]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php feof () function]]></category>
		<category><![CDATA[php function in reading file]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Tutorial for feof () in Reading file]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[Why]]></category>
		<category><![CDATA[with example]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7993</guid>

					<description><![CDATA[<p>What is feof () used in Reading file? The feof() function in PHP is an inherent function that checks a [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-feof-in-reading-file/">Tutorial for feof () in Reading file</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">What is feof () used in Reading file?</h3>



<p class="wp-block-paragraph">The <code><span class="has-inline-color has-vivid-red-color"><strong>feof()</strong></span></code> function in PHP is an inherent function that checks a file pointer for the end-of-file. It determines whether or not the &#8220;end-of-file&#8221; has been reached. If the size of the content of a file is not known ahead of time, the <code><span class="has-inline-color has-vivid-red-color"><strong>feof()</strong></span></code> method is used to loop over it.</p>



<h3 class="wp-block-heading">Why  feof () used in Reading file ?</h3>



<p class="wp-block-paragraph">If the end-of-file has been reached or an error has occurred, the <span class="has-inline-color has-vivid-red-color"><code><strong>feof()</strong></code></span> method returns True. Otherwise, False is returned.</p>



<p class="wp-block-paragraph"><strong>Syntax:</strong> </p>



<pre class="wp-block-code"><code><code><span class="has-inline-color has-vivid-red-color"><strong>feof( $file )</strong></span></code></code></pre>



<p class="wp-block-paragraph"><strong>Parameters:</strong></p>



<p class="wp-block-paragraph">In PHP, the <code><span class="has-inline-color has-vivid-red-color"><strong>feof()</strong></span></code> method takes only one parameter,<code><span class="has-inline-color has-vivid-red-color"><strong> $file</strong></span></code>. The file to be examined for end-of-file is specified by this argument.</p>



<p class="wp-block-paragraph"><strong>Return Value:</strong></p>



<p class="wp-block-paragraph">If the end of the file has been reached or an error has occurred, it returns TRUE. Otherwise, False is returned.</p>



<p class="wp-block-paragraph"><strong>Errors And Exception</strong>:</p>



<ul class="wp-block-list"><li>If the supplied file reference is invalid, it enters an infinite loop since end-of-file does not return True.</li><li>If a connection opened by <code><span class="has-inline-color has-vivid-red-color"><strong>fsockopen()</strong></span></code> is not terminated by the server, the<code><span class="has-inline-color has-vivid-red-color"><strong> feof()</strong></span></code> function hangs.</li></ul>



<h3 class="wp-block-heading">Let’s take one Example:-</h3>



<p class="wp-block-paragraph">Below examples will explain the feof() function:</p>



<p class="wp-block-paragraph"><strong>Example 1:-</strong> In the below program the file named “test.txt” contains only a single line of text which is “This file consists of only a single line.”.</p>



<script src="https://gist.github.com/AdarshAshwani/68ebbe41bd2cc8410c7d687aa092ef04.js"></script>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" width="461" height="47" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-117.png" alt="" class="wp-image-8006" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-117.png 461w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-117-300x31.png 300w" sizes="(max-width: 461px) 100vw, 461px" /></figure>



<p class="wp-block-paragraph"><strong>Example 2:-</strong> In the below program the file named “test-test.txt” contains the following text.</p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">This is the first line.
This is the second line.
This is the third line.</span></code></pre>



<script src="https://gist.github.com/AdarshAshwani/11e0cf5de4607cf2f1256215b244a0b1.js"></script>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" width="258" height="80" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-118.png" alt="" class="wp-image-8007"/></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-feof-in-reading-file/">Tutorial for feof () in Reading file</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/tutorial-for-feof-in-reading-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
