<?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>For loop Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/for-loop/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/for-loop/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 31 Jul 2021 12:57:27 +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 &#8220;For&#8221; loop</title>
		<link>https://www.scmgalaxy.com/tutorials/tutorial-for-for-loop/</link>
					<comments>https://www.scmgalaxy.com/tutorials/tutorial-for-for-loop/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Sat, 31 Jul 2021 12:57:25 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[For loop]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php loops]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Tutorial for For loop]]></category>
		<category><![CDATA[Tutorials for PHP Loops]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is For Loops]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7235</guid>

					<description><![CDATA[<p>What is For Loops? The For loop is a control structure that repeatedly executes a block of code until a condition is [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-for-loop/">Tutorial for &#8220;For&#8221; loop</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 <strong>For</strong> Loops?</h3>



<p class="wp-block-paragraph">The For loop is a control structure that repeatedly executes a block of code until a condition is met. It&#8217;s commonly used to make a code block repeat itself a set number of times. It should be used if the number of iterations is given; otherwise, a while loop should be used. You use for loop when you already know how many times you want to run a block of code. It permits users to centralize all comments concerning the loop.</p>



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



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">for (init counter; test counter; increment counter) {
  code to be executed for each iteration;
}</span></code></pre>



<p class="wp-block-paragraph"><strong>The for loop in PHP is similar to the for loop in Java/C/C++. The following are the definitions of the (for loop) parameters:</strong></p>



<ul class="wp-block-list"><li><span class="has-inline-color has-vivid-red-color"><strong><code>initialization</code></strong> </span>–It is used to set the counter variables and checked before the body of the loop is executed once unconditionally.</li><li><strong><code><span class="has-inline-color has-vivid-red-color">condition</span></code></strong> – At the beginning of each repetition, the state is assessed. The loop remains if it is true and the nesting statements are performed. If it is wrong, the loop is finished.</li><li><span class="has-inline-color has-vivid-red-color"><strong><code>increment</code></strong> </span>– The loop counter adds a new value. It is assessed at the end of every iteration.</li></ul>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://static.javatpoint.com/phppages/images/forloop.png" alt="php for loop flowchart"/></figure></div>



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



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



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



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://www.devopsschool.com/blog/wp-content/uploads/2021/05/image-44.png" alt=""/></figure></div>



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



<script src="https://gist.github.com/AdarshAshwani/85a675415b8d04b4bb3c8d8ce078261d.js"></script>



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



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://www.devopsschool.com/blog/wp-content/uploads/2021/05/image-45.png" alt=""/></figure></div>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/tutorial-for-for-loop/">Tutorial for &#8220;For&#8221; loop</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-for-loop/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
