<?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>Logic Matters! Free Video Tutorials – PHP,Flash,Photoshop,SEO,Website Designing,Robotics,C,C++ … &#187; PHP Tutorial</title>
	<atom:link href="http://www.lmtutorials.com/tag/php-tutorial/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lmtutorials.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Jun 2011 11:33:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>PHP Tutorial Part 7 [PHP Functions, with Arguments, with more than one argument, Functions having Return values, Global Functions]</title>
		<link>http://www.lmtutorials.com/php-tutorial-part-7</link>
		<comments>http://www.lmtutorials.com/php-tutorial-part-7#comments</comments>
		<pubDate>Fri, 29 May 2009 02:27:53 +0000</pubDate>
		<dc:creator>Root Admin</dc:creator>
				<category><![CDATA[All Post]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.lmtutorials.com/?p=64</guid>
		<description><![CDATA[PHP Video Tutorial Part 7 Part 6: Documentation + Video  [PHP Functions, with Arguments, with more than one argument, Functions having Return values, Global Functions] &#160; &#8220;Documentation&#8221; Hello Friends, Welcome To PHP Tutorial Part 7 Topic Covered: PHP Functions, with Arguments, with more than one argument, Functions having Return values, Global Functions ______________________________________________________________________________________________ Today covered [...]]]></description>
			<content:encoded><![CDATA[<p>PHP Video Tutorial Part 7</p>
<p><strong>Part 6: </strong> Documentation + Video  [PHP Functions, with Arguments, with more than one argument, Functions having Return values, Global Functions]<!--[endif]--></p>
<p><a href="http://www.lmtutorials.com/php-tutorial-part-7"><em>Click here to view the embedded video.</em></a></p>
<p>&nbsp;</p>
<p><span id="more-64"></span></p>
<p style="text-align: center;"><span style="text-decoration: underline;"><span style="font-size: x-large;"><span style="color: #ff0000;"><strong>&#8220;Documentation&#8221;</strong></span></span></span></p>
<p style="text-align: left;"><span style="font-size: x-large;"><span style="color: #ff0000;"><strong><br />
</strong></span></span></p>
<p><strong>Hello Friends,</strong></p>
<p><span style="color: #ff0000;"><strong><span style="text-decoration: underline;">Welcome To PHP Tutorial Part 7</span></strong></span></p>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">Topic Covered:</span></em></strong><strong><em> </em></strong><em>PHP Functions, with Arguments, with more than one argument, Functions having Return values, Global Functions</em></span></p>
<p>______________________________________________________________________________________________</p>
<p>Today covered in this tutorial PHP Functions, with Arguments, with more than one argument, Functions having Return alues, Global Functions</p>
<p><span style="color: #ff0000;"><strong><span style="text-decoration: underline;">PHP Functions:</span></strong></span></p>
<p>The powerful feature of any programming language is the ability to define and use functions.PHP function is a bit of code that we can reuse quickly and easily in PHP pages when we need it.</p>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">For creating functions:</span></em></strong></span></p>
<p><em>1. All functions start with the word &#8220;function()&#8221; .</em></p>
<p><em>2. The name can start with a letter or underscore (not a number).</em></p>
<p><em>3. Unlike string names the function names are case in sensitive.</em></p>
<p><em>4. Function code starts after Curl brackets &#8220;{&#8221; and end by closing a Curl brackets&#8221;}&#8221;.</em></p>
<p><em>5. The name of the function can be anything you want as similar to strings name can contain letters, numbers, underscores and dashes, but it cannot contain any spaces.</em></p>
<p><em><br />
</em></p>
<blockquote><p>&lt;?php<br />
function hello()                    // Function declaration<br />
{<br />
echo &#8220;Hello Mr.Saini&#8221;;<br />
}<br />
// no output when we only declare the function, output is there only when we call it. let check<br />
// the title is changed but no output mean code will not execute:)<br />
hello();     //Function calling<br />
?&gt;</p></blockquote>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">Now come to PHP Functions with Arguments:</span></strong></span></p>
<p>For more flexibility and more functionality to functions we add arguments or parameters, these are like variables, and we can define more than one functions. But two function names must be different if same then it will error like:</p>
<p><strong>&#8220;Fatal error: cannot redeclare.”</strong></p>
<blockquote><p>&lt;?php</p>
<p>function hello($name)                    // Function declaration</p>
<p>{</p>
<p>echo &#8220;Hello $name&#8221;;</p>
<p>}</p>
<p>// no output when we only declare the function, output is there only when we call it.</p>
<p>hello (&#8220;Mr.Saini&#8221;) ;     //Function calling</p>
<p>echo &#8220;&lt;br /&gt;&#8221;;</p>
<p>// you can use  variable or text in place of arguments thats why its flexible</p>
<p>// we can also use vairables in the arguments and more than one calls to same function.</p>
<p>hello(&#8220;Everyone&#8221;);     //Function calling 2nd time</p>
<p>echo &#8220;&lt;br /&gt;&#8221;;</p>
<p>$user = &#8220;Manan Saini&#8221;;</p>
<p>hello(&#8220;$user&#8221;);      // use variable ; you see the flexibity with arguments</p>
<p>?&gt;</p></blockquote>
<p>You can see functions with argument has more flexible than static one, and function must be defined before calling it otherwise it will show error <strong>&#8220;fatal error: Undefined function</strong>&#8221; like that.</p>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">PHP Functions with more than one argument:</span></strong></span></p>
<blockquote><p>&lt;?php</p>
<p>function hello($wishes, $name, $punct) // Function declaration</p>
<p>{</p>
<p>echo $wishes . $name . $punct . &#8220;&lt;br /&gt;&#8221;;</p>
<p>}</p>
<p>$user = &#8220;Manan Saini&#8221;;  // variable declared</p>
<p>hello(&#8220;Gud Luck&#8221;,$user,&#8221;!&#8221;);       // function calling</p>
<p>/*</p>
<p>The no. of arguments must be same as no. of declared arguments.</p>
<p>Check what happens when we declare less argument. Delete any one of the above argument.</p>
<p>You see error missing arguments.</p>
<p>*/</p>
<p>?&gt;</p></blockquote>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">PHP Functions &#8211; Return values:</span></strong></span></p>
<p>Functions can also be used to return values.</p>
<blockquote><p>&lt;?php</p>
<p>function addition($var1,$var2)</p>
<p>{</p>
<p>$sum = $var1 + $var2;</p>
<p>return $sum;</p>
<p>}</p>
<p>$total =addition(4,5); // declare variable we can use again &amp; again in the code.</p>
<p>echo $total;</p>
<p>/* return can only return one value for returning more than one function we can use arrays. Take a look the below code.</p>
<p>*/</p>
<p>function add_sub($var1,$var2)</p>
<p>{</p>
<p>$add = $var1 + $var2;</p>
<p>$sub = $var1 &#8211; $var2;</p>
<p>$result = array($add,$sub);</p>
<p>return $result;</p>
<p>}</p>
<p>$total =add_sub(4,5);</p>
<p>echo &#8220;&lt;br /&gt;&#8221; . &#8220;Addition is&#8221; . $total[0]. &#8220;&lt;br /&gt;&#8221;;</p>
<p>echo &#8220;Subtraction is&#8221; . $total[1]. &#8220;&lt;br /&gt;&#8221;;</p>
<p>?&gt;</p></blockquote>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">PHP Functions &#8211; Global :</span></strong></span></p>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;"><br />
</span></strong></span></p>
<blockquote><p>&lt;?php</p>
<p>$var = &#8220;Global&#8221;;</p>
<p>function glo() {</p>
<p>$var = &#8220;Local&#8221;;</p>
<p>}</p>
<p>glo();</p>
<p>echo $var ;</p>
<p>// just predict the output. What we do if we want to show locally let’s check.</p>
<p>?&gt;&lt;br /&gt;&lt;br /&gt;</p>
<p>&lt;?php</p>
<p>$var = &#8220;Global&#8221;;</p>
<p>function glo1() {</p>
<p>global $var;                         // now it will show local</p>
<p>$var = &#8220;Local&#8221;;</p>
<p>}</p>
<p>glo1(); // because function name must be different so <img src='http://www.lmtutorials.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>echo $var ;</p>
<p>// another method to declare locally is:</p>
<p>?&gt;&lt;br /&gt;&lt;br /&gt;</p>
<p>&lt;?php</p>
<p>$var1 = &#8220;Global&#8221;;</p>
<p>function glo2($var)</p>
<p>{</p>
<p>$var = &#8220;Local&#8221;;</p>
<p>return $var;</p>
<p>}</p>
<p>$var1 = glo2($var1);</p>
<p>echo $var1;</p>
<p>?&gt;</p>
<p>&nbsp;</p></blockquote>
<p>Thanks for reading this documentation.                                                           <em><span style="text-decoration: underline;">Continue in Next Edition ….</span></em><em> </em></p>
<p><strong> </strong></p>
<p><strong>Thanks,</strong></p>
<p><strong>Tutorials By:</strong> <strong>Manan Saini </strong> <strong><span style="text-decoration: underline;">Join us:</span></strong> <strong><a href="../">www.lmtutorials.com</a> </strong></p>
<p><strong> www.logicmatters.org </strong><em> </em></p>
<p><strong>Thanks,</strong></p>
<p><strong>LM Team!</strong></p>



If you like it, then why not share with others and bookmark it :


	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;partner=sociable" title="Print"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&amp;bodytext=PHP%20Video%20Tutorial%20Part%207%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0A%0D%0A%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tuto" title="Digg"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7" title="Sphinn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&amp;notes=PHP%20Video%20Tutorial%20Part%207%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0A%0D%0A%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tuto" title="del.icio.us"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;t=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="Facebook"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="Mixx"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&amp;annotation=PHP%20Video%20Tutorial%20Part%207%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0A%0D%0A%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tuto" title="Google Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.blogospherenews.com/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="Blogosphere News"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogospherenews.png" title="Blogosphere News" alt="Blogosphere News" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&amp;body=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7" title="email"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://internetmedia.hu/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7" title="Internetmedia"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/im.png" title="Internetmedia" alt="Internetmedia" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&amp;source=Logic+Matters%21+Free+Video+Tutorials+%E2%80%93+PHP%2CFlash%2CPhotoshop%2CSEO%2CWebsite+Designing%2CRobotics%2CC%2CC%2B%2B+%E2%80%A6+&amp;summary=PHP%20Video%20Tutorial%20Part%207%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0A%0D%0A%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tuto" title="LinkedIn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="Live"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reporter.nl.msn.com/?fn=contribute&amp;Title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&amp;URL=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;cat_id=6&amp;tag_id=31&amp;Remark=PHP%20Video%20Tutorial%20Part%207%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0A%0D%0A%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tuto" title="MSN Reporter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/msnreporter.png" title="MSN Reporter" alt="MSN Reporter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;t=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="MySpace"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;partner=sociable" title="PDF"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.sphere.com/search?q=sphereit:http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="SphereIt"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphere.png" title="SphereIt" alt="SphereIt" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="StumbleUpon"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7" title="Technorati"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%20-%20http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7" title="Twitter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;t=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&opener=bm&amp;ei=UTF-8&amp;d=PHP%20Video%20Tutorial%20Part%207%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0A%0D%0A%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tuto" title="Yahoo! Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;submitHeadline=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D&amp;submitSummary=PHP%20Video%20Tutorial%20Part%207%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0A%0D%0A%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tuto&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.lmtutorials.com/feed" title="RSS"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-7&amp;title=PHP%20Tutorial%20Part%207%20%5BPHP%20Functions%2C%20with%20Arguments%2C%20with%20more%20than%20one%20argument%2C%20Functions%20having%20Return%20values%2C%20Global%20Functions%5D" title="blogmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.lmtutorials.com/php-tutorial-part-7/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial Part 6 [while, dowhile, for, foreach loops and array pointers ]</title>
		<link>http://www.lmtutorials.com/php-tutorial-part-6</link>
		<comments>http://www.lmtutorials.com/php-tutorial-part-6#comments</comments>
		<pubDate>Wed, 27 May 2009 00:35:06 +0000</pubDate>
		<dc:creator>Root Admin</dc:creator>
				<category><![CDATA[All Post]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>

		<guid isPermaLink="false">http://www.lmtutorials.com/?p=46</guid>
		<description><![CDATA[PHP Video Tutorial Part 6 Part 6: Documentation + Video  [while,dowhile,for,foreach,loops and array] &#160; &#8220;Documentation&#8220; Hello Friends, Welcome To PHP Tutorial Part 6 Topic Covered: while, dowhile, for, foreach loops and array pointers ___________________________________________________________________ Today covered in this tutorial while, dowhile, for, foreach loops and array pointers Loops If some action happens over and over [...]]]></description>
			<content:encoded><![CDATA[<p>PHP Video Tutorial Part 6</p>
<p><strong>Part 6: </strong> Documentation + Video  [while,dowhile,for,foreach,loops and array]<!--[endif]--></p>
<p><a href="http://www.lmtutorials.com/php-tutorial-part-6"><em>Click here to view the embedded video.</em></a></p>
<p>&nbsp;</p>
<p><span id="more-46"></span></p>
<p style="text-align: center;"><span style="font-size: x-large;"><span style="color: #ff0000;"><strong>&#8220;</strong><span style="text-decoration: underline;"><strong>Documentation</strong></span><strong>&#8220;</strong></span></span></p>
<p><strong>Hello Friends,</strong></p>
<p><span style="color: #ff0000;"><strong><span style="text-decoration: underline;">Welcome To PHP Tutorial Part 6</span></strong></span></p>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">Topic Covered:</span></em></strong><strong><em> </em></strong><em><span style="text-decoration: underline;">while, dowhile, for, foreach loops and array pointers</span></em></span></p>
<p>___________________________________________________________________</p>
<p>Today covered in this tutorial while, dowhile, for, foreach loops and array pointers</p>
<p><span style="color: #ff0000;"><strong><span style="text-decoration: underline;">Loops</span></strong></span></p>
<p>If some action happens over and over again then we need Loops. Loops allow us to execute a bit of code until the condition is satisfied. There are 4 main kinds of loops:</p>
<ul>
<li>while loops</li>
<li>do-while loops</li>
<li>for loops</li>
<li>foreach loops</li>
</ul>
<p><span style="color: #0000ff;"><strong><em>1. </em></strong><strong><em><span style="text-decoration: underline;">while Loop:</span></em></strong></span></p>
<p>The while statement will execute a code as long as a condition is true. Take look at syntax:</p>
<p><img src="http://img34.imageshack.us/img34/9522/whiledowhile3179692.jpg" alt="Syntax of while and do while loop" width="496" height="300" /></p>
<blockquote><p><em>&lt;?php </em></p>
<p><em> $count=1;</em></p>
<p><em> while($count&lt;=10)</em></p>
<p><em> {</em></p>
<p><em> echo &#8220;Count is &#8221; . $count . &#8220;&lt;br /&gt;&#8221;;</em></p>
<p><em> $count++;  // ++ is used to increment</em></p>
<p><em> }</em></p>
<p><em> </em></p>
<p><em>/*</em></p>
<p><em>The loop will run continue until the condition is true , i.e. the value of count is less than equal to 10. The loop will increment after every execution mean after each time loop runs.</em></p>
<p><em>*/</em></p>
<p><em>?&gt;</em></p>
<p><em><br />
</em></p></blockquote>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">2. dowhile Loop</span></em></strong></span></p>
<p>The dowhile loop will execute a code at least once &#8211; then it will repeat the loop as long as a condition is true. Check the syntax above.</p>
<p>First loop will execute and then condition is checked.</p>
<p><strong>The main difference between while and do while loop is</strong> in while first condition is check then program executed,             but in case of do while first program will execute then it will check the condition. Means do while loop will always run at least once.</p>
<blockquote><p><em>&lt;?php </em></p>
<p><em> $count=0;</em></p>
<p><em> do</em></p>
<p><em> {</em></p>
<p><em> $count++; </em></p>
<p><em> echo &#8220;Count is &#8221; . $count . &#8220;&lt;br /&gt;&#8221;;</em></p>
<p><em> }</em></p>
<p><em> while ($count&lt;=10);</em></p>
<p><em> </em></p>
<p><em>/*</em></p>
<p><em>The loop will run continue untill the condition is true , i.e. the value of count is less than equal to 10. The loop will increment after every execution mean after each time loop runs. It will run atleast once always.The condition is checked after the execution of loop.</em></p>
<p><em>It shows output till 11 because condition is checked after the execution of loop.</em></p>
<p><em>*/</em></p>
<p><em> ?&gt;</em></p></blockquote>
<p><span style="color: #0000ff;"><strong><em>3. </em></strong><strong><em><span style="text-decoration: underline;">for Loop</span></em></strong></span></p>
<p>for loop is used when you know how many times you want to execute a loop.</p>
<p><strong>The difference between while and for loop is that</strong>, while loop is used where we don&#8217;t know how many time loop execute and for loop is used where we know how many times we want to execute a loop.</p>
<p>Let’s take a look at syntax:</p>
<p><img title="syntax of for and foreach loop" src="http://img38.imageshack.us/img38/8056/forforeach3760627.jpg" alt="syntax of for and foreach loop" width="493" height="275" /></p>
<blockquote><p><em>&lt;?php</em></p>
<p><em> for ($count=0; $count&lt;=10; $count++)</em></p>
<p><em> {</em></p>
<p><em> echo $count . &#8220;&lt;br /&gt;&#8221;;</em></p>
<p><em> }</em></p>
<p><em> ?&gt;</em></p></blockquote>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">4. foreach Loop</span></em></strong></span></p>
<p>The foreach statement is only work with arrays, for looping in the array. Take a look at syntax above.</p>
<p>For every loop, the value of the $array is assigned to $value- so on the next loop and continue.</p>
<blockquote><p><em>&lt;?php</em></p>
<p><em> $numbers =array(5,10,15,20,25,30); // declaration of array</em></p>
<p><em> foreach($numbers as $num) {   //numbers is the temp variable</em></p>
<p><em> echo $num . &#8221; &lt;br /&gt; &#8220;;</em></p>
<p><em> }</em></p>
<p><em> </em></p>
<p><em> ?&gt;</em></p></blockquote>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">Next is Array Pointers:</span></em></strong></span></p>
<p>Pointers point to the current value of an array by default it’s always the first value. When we start looping through array the computer moves the pointer along the array to get each value.</p>
<p><strong>More clear with program:</strong></p>
<blockquote><p><em>&lt;?php</em></p>
<p><em> $count =array(5,10,15,20,25);</em></p>
<p><em>// current function will gives the current value of array on which it points.</em></p>
<p><em> echo &#8220;First: &#8221; . current($count) . &#8220;&lt;br /&gt;&#8221; ;</em></p>
<p><em>// next function will move the pointer to next value.</em></p>
<p><em> next($count);</em></p>
<p><em> echo &#8220;Second&#8221; . current($count) . &#8220;&lt;br /&gt;&#8221; ;</em></p>
<p><em>// reset function reset its default location i.e. first vaule.</em></p>
<p><em> reset($count);</em></p>
<p><em> echo &#8220;Third: &#8221; . current($count) . &#8220;&lt;br /&gt;&#8221; ;</em></p>
<p><em> ?&gt;</em></p>
<p><em><br />
</em></p></blockquote>
<p>Thanks for reading this documentation.        <em><span style="text-decoration: underline;"></span></em><em> </em></p>
<p><em><br />
</em></p>
<p><span style="color: #ff0000;"><strong>Thanks,</strong></span></p>
<p><span style="color: #ff0000;"><strong>LM Team!</strong></span></p>



If you like it, then why not share with others and bookmark it :


	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;partner=sociable" title="Print"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&amp;bodytext=PHP%20Video%20Tutorial%20Part%206%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bwhile%2Cdowhile%2Cfor%2Cforeach%2Cloops%20and%20array%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%206%0D%0A%0D%0ATopic%20Covered%3A%20while%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20ar" title="Digg"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6" title="Sphinn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&amp;notes=PHP%20Video%20Tutorial%20Part%206%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bwhile%2Cdowhile%2Cfor%2Cforeach%2Cloops%20and%20array%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%206%0D%0A%0D%0ATopic%20Covered%3A%20while%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20ar" title="del.icio.us"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;t=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="Facebook"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="Mixx"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&amp;annotation=PHP%20Video%20Tutorial%20Part%206%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bwhile%2Cdowhile%2Cfor%2Cforeach%2Cloops%20and%20array%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%206%0D%0A%0D%0ATopic%20Covered%3A%20while%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20ar" title="Google Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.blogospherenews.com/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="Blogosphere News"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogospherenews.png" title="Blogosphere News" alt="Blogosphere News" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&amp;body=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6" title="email"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://internetmedia.hu/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6" title="Internetmedia"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/im.png" title="Internetmedia" alt="Internetmedia" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&amp;source=Logic+Matters%21+Free+Video+Tutorials+%E2%80%93+PHP%2CFlash%2CPhotoshop%2CSEO%2CWebsite+Designing%2CRobotics%2CC%2CC%2B%2B+%E2%80%A6+&amp;summary=PHP%20Video%20Tutorial%20Part%206%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bwhile%2Cdowhile%2Cfor%2Cforeach%2Cloops%20and%20array%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%206%0D%0A%0D%0ATopic%20Covered%3A%20while%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20ar" title="LinkedIn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="Live"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reporter.nl.msn.com/?fn=contribute&amp;Title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&amp;URL=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;cat_id=6&amp;tag_id=31&amp;Remark=PHP%20Video%20Tutorial%20Part%206%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bwhile%2Cdowhile%2Cfor%2Cforeach%2Cloops%20and%20array%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%206%0D%0A%0D%0ATopic%20Covered%3A%20while%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20ar" title="MSN Reporter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/msnreporter.png" title="MSN Reporter" alt="MSN Reporter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;t=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="MySpace"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;partner=sociable" title="PDF"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.sphere.com/search?q=sphereit:http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="SphereIt"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphere.png" title="SphereIt" alt="SphereIt" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="StumbleUpon"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6" title="Technorati"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D%20-%20http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6" title="Twitter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;t=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&opener=bm&amp;ei=UTF-8&amp;d=PHP%20Video%20Tutorial%20Part%206%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bwhile%2Cdowhile%2Cfor%2Cforeach%2Cloops%20and%20array%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%206%0D%0A%0D%0ATopic%20Covered%3A%20while%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20ar" title="Yahoo! Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;submitHeadline=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D&amp;submitSummary=PHP%20Video%20Tutorial%20Part%206%0D%0A%0D%0APart%206%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bwhile%2Cdowhile%2Cfor%2Cforeach%2Cloops%20and%20array%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%206%0D%0A%0D%0ATopic%20Covered%3A%20while%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20ar&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.lmtutorials.com/feed" title="RSS"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-6&amp;title=PHP%20Tutorial%20Part%206%20%5Bwhile%2C%20dowhile%2C%20for%2C%20foreach%20loops%20and%20array%20pointers%20%5D" title="blogmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.lmtutorials.com/php-tutorial-part-6/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial Part 5 [if, if-else, elseif and switch statements]</title>
		<link>http://www.lmtutorials.com/php-tutorial-part-5</link>
		<comments>http://www.lmtutorials.com/php-tutorial-part-5#comments</comments>
		<pubDate>Wed, 27 May 2009 00:18:53 +0000</pubDate>
		<dc:creator>Root Admin</dc:creator>
				<category><![CDATA[All Post]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.lmtutorials.com/?p=38</guid>
		<description><![CDATA[PHP Video Tutorial Part 5 Part 5: Documentation + Video  [if, if-else, elseif and switch statements] &#160; &#8220;DOCUMENTATION&#8220; Hello Friends, Welcome To PHP Tutorial Part 5 Topic Covered: if, if-else, elseif and switch statements ____________________________________________________________________________________________ Today we will discuss if, if-else, elseif and switch statements 1. If Statement: If you want to execute some code [...]]]></description>
			<content:encoded><![CDATA[<p>PHP Video Tutorial Part 5</p>
<p><strong>Part 5: </strong> Documentation + Video  [<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>PA</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val=" " /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideW<br />
henUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Lo<br />
cked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!--[endif]--><em><span style="text-decoration: underline;"><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: blue;">if, if-else, elseif and switch statements</span></span></em>]</p>
<p><a href="http://www.lmtutorials.com/php-tutorial-part-5"><em>Click here to view the embedded video.</em></a></p>
<p>&nbsp;</p>
<p><span id="more-38"></span></p>
<p style="text-align: center;"><span style="color: #ff0000;"><span style="font-size: x-large;"><strong>&#8220;</strong><span style="text-decoration: underline;"><strong>DOCUMENTATION</strong></span></span></span><span style="color: #ff0000;"><span style="font-size: x-large;"><strong>&#8220;</strong></span></span></p>
<p>Hello Friends,</p>
<p><span style="color: #ff0000;"><strong><span style="text-decoration: underline;">Welcome To PHP Tutorial Part 5</span></strong></span></p>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">Topic Covered:</span></em></strong><strong><em> </em></strong><em><span style="text-decoration: underline;">if, if-else, elseif and switch statements</span></em></span></p>
<p>____________________________________________________________________________________________</p>
<p>Today we will discuss if, if-else, elseif and switch statements</p>
<p><span style="color: #0000ff;"><strong><em>1. </em></strong><strong><em><span style="text-decoration: underline;">If Statement:</span></em></strong></span></p>
<p>If you want to execute some code if the condition is true, then use the if statement.  Let’s take a look at syntax:</p>
<p><img title="if and if else syntax" src="http://img31.imageshack.us/img31/29/ifelse4165644.jpg" alt="if and if else syntax" width="498" height="255" /></p>
<p>The code will execute only if the condition is true, In this case the condition will not satisfied so the code will not execute.</p>
<blockquote><p>&lt;?php</p>
<p>$a=2;</p>
<p>$b=3;</p>
<p>if ($a &gt; $b) {</p>
<p>echo &#8220;a is greater than b&#8221;;</p>
<p>}</p>
<p>?&gt;</p></blockquote>
<p>You can check in this case there is no output. So just swap the values. And you will find it will show you &#8220;a is greater than b&#8221;.You can Try Using the other Boolean expressions also i.e. Logical and comparison operators <img src='http://www.lmtutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><em> </em></strong></p>
<p><span style="color: #0000ff;"><strong><em>1. </em></strong><strong><em><span style="text-decoration: underline;"> If &#8211; else statements :</span></em></strong></span></p>
<p>If you want to execute some code if one condition is true, and in another code if first condition is false, use the if &#8211; else statement.</p>
<p>Take a look above at syntax:</p>
<blockquote><p><em>&lt;?php</em></p>
<p><em> $a=3;</em></p>
<p><em> $b=2;</em></p>
<p><em> if ($a &gt; $b){</em></p>
<p><em> echo &#8220;a is greater than b&#8221;; </em></p>
<p><em> }</em></p>
<p><em> else {</em></p>
<p><em> echo &#8220;b is greater than a&#8221;;</em></p>
<p><em> }</em></p>
<p><em> ?&gt;</em></p></blockquote>
<p><span style="color: #0000ff;"><strong><em>3. </em></strong><strong><em>ElseIf Statement:</em></strong></span></p>
<p>We have another option if you want to execute some code in which more than one or several conditions are true then use the elseif statement.lets check the syntax of elseif:</p>
<p><img title="if else if syntax" src="http://img146.imageshack.us/img146/8091/elseif4490390.jpg" alt="if else if syntax" width="493" height="261" /></p>
<p><span style="color: #0000ff;"><strong><em>4. </em></strong><strong><em><span style="text-decoration: underline;">Switch Statement:</span></em></strong></span></p>
<p>If you want to execute one statement from number of statements, then use the Switch statement. This is more efficient method than previous one. Take a look at syntax:</p>
<p><em><img title="switch syntax" src="http://img87.imageshack.us/img87/1161/switch4532752.jpg" alt="switch syntax" width="496" height="272" /></em></p>
<p>If the expression has value equal to value 1 then it will execute the statement inside it and break is used to terminate and go. If the expression has not equal to any value then it will execute default loop. In default its optional break.</p>
<p>Take a look at program:</p>
<blockquote><p><em>&lt;?php</em></p>
<p><em> $a = 2;</em></p>
<p><em> switch ($a)</em></p>
<p><em> {</em></p>
<p><em> case 0:</em></p>
<p><em> echo &#8220;a has value = 0&#8243;;</em></p>
<p><em> break;</em></p>
<p><em> case 1:</em></p>
<p><em> echo &#8220;a has value = 1&#8243;;</em></p>
<p><em> break;</em></p>
<p><em> case 2:</em></p>
<p><em> echo &#8220;a has value = 2&#8243;;</em></p>
<p><em> break;</em></p>
<p><em> default:</em></p>
<p><em> echo &#8220;a is not equal to 0,1,2&#8243;;</em></p>
<p><em> break;      // optional using break at the last</em></p>
<p><em> </em></p>
<p><em> }</em></p>
<p><em> ?&gt;</em></p></blockquote>
<p>Hope you enjoying the tutorial.</p>
<p>Thanks for reading this documentation.       <em><span style="text-decoration: underline;"></span></em><em> </em></p>
<p><span style="color: #ff0000;"><strong><br />
</strong></span></p>
<p><span style="color: #ff0000;"><strong>Thanks,</strong></span></p>
<p><span style="color: #ff0000;"><strong>LM Team!</strong></span></p>



If you like it, then why not share with others and bookmark it :


	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;partner=sociable" title="Print"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&amp;bodytext=PHP%20Video%20Tutorial%20Part%205%0D%0A%0D%0APart%205%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22DOCUMENTATION%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%205%0D%0A%0D%0ATopic%20Covered%3A%20if%2C%20if-else%2C%20elseif%20and%20switch%20statements" title="Digg"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5" title="Sphinn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&amp;notes=PHP%20Video%20Tutorial%20Part%205%0D%0A%0D%0APart%205%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22DOCUMENTATION%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%205%0D%0A%0D%0ATopic%20Covered%3A%20if%2C%20if-else%2C%20elseif%20and%20switch%20statements" title="del.icio.us"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;t=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="Facebook"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="Mixx"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&amp;annotation=PHP%20Video%20Tutorial%20Part%205%0D%0A%0D%0APart%205%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22DOCUMENTATION%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%205%0D%0A%0D%0ATopic%20Covered%3A%20if%2C%20if-else%2C%20elseif%20and%20switch%20statements" title="Google Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.blogospherenews.com/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="Blogosphere News"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogospherenews.png" title="Blogosphere News" alt="Blogosphere News" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&amp;body=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5" title="email"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://internetmedia.hu/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5" title="Internetmedia"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/im.png" title="Internetmedia" alt="Internetmedia" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&amp;source=Logic+Matters%21+Free+Video+Tutorials+%E2%80%93+PHP%2CFlash%2CPhotoshop%2CSEO%2CWebsite+Designing%2CRobotics%2CC%2CC%2B%2B+%E2%80%A6+&amp;summary=PHP%20Video%20Tutorial%20Part%205%0D%0A%0D%0APart%205%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22DOCUMENTATION%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%205%0D%0A%0D%0ATopic%20Covered%3A%20if%2C%20if-else%2C%20elseif%20and%20switch%20statements" title="LinkedIn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="Live"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reporter.nl.msn.com/?fn=contribute&amp;Title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&amp;URL=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;cat_id=6&amp;tag_id=31&amp;Remark=PHP%20Video%20Tutorial%20Part%205%0D%0A%0D%0APart%205%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22DOCUMENTATION%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%205%0D%0A%0D%0ATopic%20Covered%3A%20if%2C%20if-else%2C%20elseif%20and%20switch%20statements" title="MSN Reporter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/msnreporter.png" title="MSN Reporter" alt="MSN Reporter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;t=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="MySpace"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;partner=sociable" title="PDF"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.sphere.com/search?q=sphereit:http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="SphereIt"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphere.png" title="SphereIt" alt="SphereIt" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="StumbleUpon"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5" title="Technorati"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%20-%20http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5" title="Twitter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;t=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&opener=bm&amp;ei=UTF-8&amp;d=PHP%20Video%20Tutorial%20Part%205%0D%0A%0D%0APart%205%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22DOCUMENTATION%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%205%0D%0A%0D%0ATopic%20Covered%3A%20if%2C%20if-else%2C%20elseif%20and%20switch%20statements" title="Yahoo! Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;submitHeadline=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D&amp;submitSummary=PHP%20Video%20Tutorial%20Part%205%0D%0A%0D%0APart%205%3A%20%20Documentation%20%2B%20Video%C2%A0%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D%0D%0A%0D%0A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%22DOCUMENTATION%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tutorial%20Part%205%0D%0A%0D%0ATopic%20Covered%3A%20if%2C%20if-else%2C%20elseif%20and%20switch%20statements&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.lmtutorials.com/feed" title="RSS"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-5&amp;title=PHP%20Tutorial%20Part%205%20%5Bif%2C%20if-else%2C%20elseif%20and%20switch%20statements%5D" title="blogmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.lmtutorials.com/php-tutorial-part-5/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP Video Tutorial Part 4 [Arrays, Arrays Functions,Type Casting]</title>
		<link>http://www.lmtutorials.com/php-video-tutorial-part-4</link>
		<comments>http://www.lmtutorials.com/php-video-tutorial-part-4#comments</comments>
		<pubDate>Sat, 23 May 2009 17:51:59 +0000</pubDate>
		<dc:creator>Root Admin</dc:creator>
				<category><![CDATA[All Post]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.lmtutorials.com/?p=27</guid>
		<description><![CDATA[PHP Video Tutorial Part 4 Part 4: Documentation + Video Avi Format [Arrays, Arrays Functions,Type Casting] Download Link : Part 4  download Size: 1.65 MB After  Extract  420 MB &#8220;Documentation&#8220; Hello Friends, Welcome To PHP Tutorial Part 4 Topic Covered: Arrays, and its Function and Type Casting Well I think you read my first tutorial [...]]]></description>
			<content:encoded><![CDATA[<p>PHP Video Tutorial Part 4</p>
<p><strong>Part 4: </strong> Documentation + Video Avi Format [Arrays, Arrays Functions,Type Casting]</p>
<p>Download Link :</p>
<p><a title="PHP video Tutorial Part 4 By Manan Saini" href="http://www.mediafire.com/?jmz1kjkjnjj" target="_blank">Part 4  download</a></p>
<p>Size: <strong>1.65 MB</strong> After  Extract  <strong><span style="color: #ff0000;">420 MB</span></strong></p>
<p><strong><span id="more-27"></span></strong></p>
<p style="text-align: center;"><span style="color: #ff0000;"><strong><span style="font-size: x-large;">&#8220;</span></strong><span style="text-decoration: underline;"><strong><span style="font-size: x-large;">Documentation</span></strong></span><strong><span style="font-size: x-large;">&#8220;</span></strong></span></p>
<p>Hello Friends,</p>
<p><span style="color: #ff0000;"><strong><span style="text-decoration: underline;">Welcome To PHP Tutorial Part 4</span></strong></span></p>
<p><span style="color: #0000ff;"><strong><em><span style="text-decoration: underline;">Topic Covered: </span></em></strong><span style="text-decoration: underline;">Arrays, and its Function and Type Casting</span></span></p>
<p><strong> </strong></p>
<p>Well I think you read my first tutorial PHP part 1, 2, 3 if not then kindly download from here:</p>
<p><a href="http://lmtutorials.com/tutorial_files/PHP_tutorials">Download  Older One’s</a></p>
<ul>
<li>Go to PHP folder and download PHP Part 1, 2 and 3</li>
</ul>
<p>________________________________________________________________________________________________</p>
<p>Today we will discuss arrays, and its function and Type casting.</p>
<p>So let’s see the simple definition of array.</p>
<p><img title="arrays" src="http://img268.imageshack.us/img268/5485/arrays5165266.jpg" alt="arrays" width="500" height="324" /></p>
<p><strong><span style="text-decoration: underline;">Types of Array:</span></strong></p>
<p><strong> </strong></p>
<p><span style="color: #0000ff;"><strong>Arrays are of three types:</strong></span></p>
<ol>
<li>Numeric array</li>
<li>Associative array</li>
<li>Multi-dimension array</li>
</ol>
<p>Let’s start with first i.e. <strong><em>Numeric</em></strong>.</p>
<blockquote><p>&lt;?php</p>
<p>$array1 = array( 0,1,2,3,4,5);         // check the syntax ..</p>
<p>echo $array1[1];                               // lets see which value it will display</p>
<p>?&gt;<em> </em></p></blockquote>
<p>You see it will display 2nd value it mean array start from 0. These 0, 1, 2, 3, 4, 5 all call <strong>pockets</strong> or <strong>ID key</strong>.</p>
<p>Now come to 2nd type i.e. <strong>Associative Array. </strong>In this case each pocket i.e. id key have some particular value. Before going to 2nd type let me show how to display string in type 1.</p>
<blockquote><p>&lt;?php</p>
<p>$array2 = array( 2, &#8220;manan&#8221;, 3 ,&#8221;OUG&#8221;);                  // u see &#8221; &#8221; double quotes for string.</p>
<p>echo $array2[1];                                                               //let’s suppose I want to display string <strong>manan</strong></p>
<p>?&gt;</p></blockquote>
<p>You see for displaying string. Now come to 2nd type <strong>Associative</strong>.</p>
<blockquote><p>&lt;?php</p>
<p>$array3 = array( &#8220;manan&#8221; =&gt;14 , &#8220;oug&#8221; =&gt; 13, &#8220;count&#8221;=&gt; 10000 ); /*see string in quotes and numeric as it . Concentrate on the i.e. equal to sign and greater than sign syntax of this type</p>
<p>*/</p>
<p>echo &#8220;&lt;br/&gt;&#8221;;</p>
<p>echo $array3["oug"];</p>
<p>?&gt;</p></blockquote>
<p>See the output, it will display the value of <strong>oug</strong> i.e is associative.</p>
<p>Now come to 3<sup>rd</sup> type i.e. multi dimension Array. Multi dimension array mean array contain 1 or more array. In this each element in the main array can also be array i.e. array inside array. Let’s c in the program it will be more clear.</p>
<blockquote><p>&lt;?php</p>
<p>$array4 = array(</p>
<p>// look care full it’s complicated. Now we make array inside arary</p>
<p>&#8220;websites&#8221;=&gt; array(</p>
<p>&#8220;orkut&#8221;,</p>
<p>&#8220;google&#8221;,</p>
<p>&#8220;logicmatters&#8221; ),</p>
<p>// create one more <img src='http://www.lmtutorials.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  <img src='http://www.lmtutorials.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>&#8220;OUG&#8221; =&gt; array(</p>
<p>&#8220;owner&#8221;,</p>
<p>&#8220;moderators&#8221;,</p>
<p>&#8220;members&#8221;</p>
<p>)</p>
<p>// now how to display on screen its output</p>
<p>);</p>
<p>echo $array4['websites'][1];</p>
<p>?&gt;</p></blockquote>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">Now come to “Type Casting “</span></strong></span></p>
<p>Well type Casting mean convert one data type into another. Now we see how we find which variable comes under which data type whether is integer or string etc.</p>
<p>Program is self explanatory. Let me tell you about this. Let’s suppose if we have one variable contains integers and string and we try to add in that variable which only contains integers then only integer values of first variable will add in to 2<sup>nd</sup> variable.</p>
<p>Let’s take a look at program var1 has integer + string and var2 having var1+ integer value. So output remains integer only because we add integer in var1.</p>
<blockquote><p>&lt;?php</p>
<p>$var1= &#8220;3 Nothing is impossible&#8221;; // 3 variable</p>
<p>$var2= $var1+27;</p>
<p>echo $var2; // answer always in terms of var2 i.e. Variable adds not string. check output</p>
<p>// See the o/p 27+3 =30</p>
<p>echo gettype($var1) .&#8221;&lt;br/&gt;&#8221;;                   // command for view which type of variable</p>
<p>echo ge                ttype($var2) .&#8221;&lt;br/&gt;&#8221;;                   // command for view which type of variable</p>
<p>settype ($var2,&#8221;string&#8221;) ;                              // <strong>command for change the type of variable</strong></p>
<p>echo gettype($var2) .&#8221;&lt;br/&gt;&#8221;;                   // command for view which type of variable</p>
<p>// See the difference now type changed</p>
<p>$var3 =(int) $var1;                                            // another <strong>method to change the type of variable</strong></p>
<p>echo gettype($var3) .&#8221;&lt;br/&gt;&#8221;;                   // command for view which type of variable</p>
<p>//Now again change it to integer type.</p>
<p>?&gt;</p></blockquote>
<p>Hope you enjoying the tutorial.</p>
<p>&nbsp;</p>
<p>Thanks for reading this documentation.                                                           <em><span style="text-decoration: underline;">Continue in Next Edition ….</span></em><em> </em></p>
<p><span style="color: #ff0000;"><strong>Thanks,</strong></span></p>
<p><span style="color: #ff0000;"><strong>LM Team!</strong></span></p>



If you like it, then why not share with others and bookmark it :


	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;partner=sociable" title="Print"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&amp;bodytext=PHP%20Video%20Tutorial%20Part%204%0D%0A%0D%0APart%204%3A%20%20Documentation%20%2B%20Video%20Avi%20Format%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%0D%0A%0D%0ADownload%20Link%20%3A%0D%0A%0D%0APart%204%C2%A0%20download%0D%0A%0D%0ASize%3A%201.65%20MB%20After%C2%A0%20Extract%C2%A0%20420%20MB%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tu" title="Digg"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4" title="Sphinn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&amp;notes=PHP%20Video%20Tutorial%20Part%204%0D%0A%0D%0APart%204%3A%20%20Documentation%20%2B%20Video%20Avi%20Format%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%0D%0A%0D%0ADownload%20Link%20%3A%0D%0A%0D%0APart%204%C2%A0%20download%0D%0A%0D%0ASize%3A%201.65%20MB%20After%C2%A0%20Extract%C2%A0%20420%20MB%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tu" title="del.icio.us"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;t=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="Facebook"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="Mixx"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&amp;annotation=PHP%20Video%20Tutorial%20Part%204%0D%0A%0D%0APart%204%3A%20%20Documentation%20%2B%20Video%20Avi%20Format%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%0D%0A%0D%0ADownload%20Link%20%3A%0D%0A%0D%0APart%204%C2%A0%20download%0D%0A%0D%0ASize%3A%201.65%20MB%20After%C2%A0%20Extract%C2%A0%20420%20MB%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tu" title="Google Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.blogospherenews.com/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="Blogosphere News"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogospherenews.png" title="Blogosphere News" alt="Blogosphere News" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&amp;body=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4" title="email"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://internetmedia.hu/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4" title="Internetmedia"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/im.png" title="Internetmedia" alt="Internetmedia" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&amp;source=Logic+Matters%21+Free+Video+Tutorials+%E2%80%93+PHP%2CFlash%2CPhotoshop%2CSEO%2CWebsite+Designing%2CRobotics%2CC%2CC%2B%2B+%E2%80%A6+&amp;summary=PHP%20Video%20Tutorial%20Part%204%0D%0A%0D%0APart%204%3A%20%20Documentation%20%2B%20Video%20Avi%20Format%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%0D%0A%0D%0ADownload%20Link%20%3A%0D%0A%0D%0APart%204%C2%A0%20download%0D%0A%0D%0ASize%3A%201.65%20MB%20After%C2%A0%20Extract%C2%A0%20420%20MB%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tu" title="LinkedIn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="Live"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reporter.nl.msn.com/?fn=contribute&amp;Title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&amp;URL=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;cat_id=6&amp;tag_id=31&amp;Remark=PHP%20Video%20Tutorial%20Part%204%0D%0A%0D%0APart%204%3A%20%20Documentation%20%2B%20Video%20Avi%20Format%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%0D%0A%0D%0ADownload%20Link%20%3A%0D%0A%0D%0APart%204%C2%A0%20download%0D%0A%0D%0ASize%3A%201.65%20MB%20After%C2%A0%20Extract%C2%A0%20420%20MB%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tu" title="MSN Reporter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/msnreporter.png" title="MSN Reporter" alt="MSN Reporter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;t=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="MySpace"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;partner=sociable" title="PDF"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.sphere.com/search?q=sphereit:http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="SphereIt"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphere.png" title="SphereIt" alt="SphereIt" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="StumbleUpon"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4" title="Technorati"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%20-%20http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4" title="Twitter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;t=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&opener=bm&amp;ei=UTF-8&amp;d=PHP%20Video%20Tutorial%20Part%204%0D%0A%0D%0APart%204%3A%20%20Documentation%20%2B%20Video%20Avi%20Format%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%0D%0A%0D%0ADownload%20Link%20%3A%0D%0A%0D%0APart%204%C2%A0%20download%0D%0A%0D%0ASize%3A%201.65%20MB%20After%C2%A0%20Extract%C2%A0%20420%20MB%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tu" title="Yahoo! Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;submitHeadline=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D&amp;submitSummary=PHP%20Video%20Tutorial%20Part%204%0D%0A%0D%0APart%204%3A%20%20Documentation%20%2B%20Video%20Avi%20Format%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D%0D%0A%0D%0ADownload%20Link%20%3A%0D%0A%0D%0APart%204%C2%A0%20download%0D%0A%0D%0ASize%3A%201.65%20MB%20After%C2%A0%20Extract%C2%A0%20420%20MB%0D%0A%0D%0A%0D%0A%22Documentation%22%0D%0AHello%20Friends%2C%0D%0A%0D%0AWelcome%20To%20PHP%20Tu&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.lmtutorials.com/feed" title="RSS"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-video-tutorial-part-4&amp;title=PHP%20Video%20Tutorial%20Part%204%20%5BArrays%2C%20Arrays%20Functions%2CType%20Casting%5D" title="blogmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.lmtutorials.com/php-video-tutorial-part-4/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial Part 1 [ Introduction ]</title>
		<link>http://www.lmtutorials.com/php-tutorial-part-1-introduction</link>
		<comments>http://www.lmtutorials.com/php-tutorial-part-1-introduction#comments</comments>
		<pubDate>Fri, 22 May 2009 01:48:37 +0000</pubDate>
		<dc:creator>Root Admin</dc:creator>
				<category><![CDATA[All Post]]></category>
		<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Tutorial]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.lmtutorials.com/?p=121</guid>
		<description><![CDATA[Hello Friends, Part one is not a video tutorial so only documentation rest all other has video tutorials. Well all of you know about web languages, there are so many languages now days. For a good website design you must have a good knowledge of any language. And me going to deliver here PHP tutorials. [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Friends,</p>
<blockquote><p><strong><span style="color: #ff0000;">Part one is not a video tutorial so only documentation rest all other has video tutorials.</span></strong></p></blockquote>
<p>Well all of you know about web languages, there are so many languages now days. For a good website design you must have a good knowledge of any language. And me going to deliver here PHP tutorials. If you have any problem in the tutorials and in PHP then you most welcome any time either in OUG or on my site. Before going through PHP you must have a little knowledge of HTML. Don’t Worry Even if you don’t know HTML, it’s very easy and simple language. Even if you googling for HTML then easily you learn and more over me also give you some basic intro about HTML during these tutorials. Let’s start some constructive work!</p>
<p><span style="color: #ff0000;"><br />
</span></p>
<ul>
<li><em><strong><span style="color: #ff0000;">First Question came in our mind what is PHP!histiory</span></strong></em></li>
</ul>
<p>Well, PHP is a server side scripting language similar to ASP originally designed for producing dynamic web pages. Because PHP is going to run on the server not on users browser like JavaScript. Client is going to be the user’s browsers. PHP can be embedded in HTML or use with HTML. PHP code is be input and web pages is the output. And we must save PHP files with .php extension like in case of HTML we use .html or .htm, PHP is open source software and free to download and use.</p>
<p style="text-align: center;"><span style="font-size: x-large;"><span style="text-decoration: underline;"><span style="color: #ff0000;"><strong>PHP HISTORY</strong></span></span></span></p>
<ol>
<li> <span style="color: #ff0000;"><strong>Version 1:1994</strong></span> PHP was originally created by Rasmus Lerdorf and it is a set of CGI Binaries in the C Programming Language.</li>
<li><span style="color: #ff0000;"><strong>Version 2: 1995</strong></span> It is the improved version of 1 by the same person and this is the first public release PHP. PHP at this point stands for “Personal Home Page Tools”.</li>
<li><strong><span style="color: #ff0000;">Version 3: 1998</span></strong> In this version two more developer involved “Andi Gutmans” and “Zeev Suraski”. And write the major part of PHP between 1997-1998. And they also Renamed it and new name is PHP: Hypertext Preprocessor .  See the PHP word is itself there in these three words, the first word be the Acronym is the Acronym itself. This is called Recursive Acronym. This version is till support by web browsers but not improved or actively maintained.</li>
<li><strong><span style="color: #ff0000;">Version 4: 2000</span></strong> Now Suraski and Gutmans formed new company called ZEND. And Zend rewrites the code PHP. And with 4 features and big update and they release in May 2000.This version is also supported by web browsers and updates like security and bug fixes. And Version 4.4.6 released on March1, 2007.</li>
<li><span style="color: #ff0000;"><strong>Version 5: 2004</strong></span> Now improved version of PHP came in July 2004 having lot of features like Object Oriented Programming (OOP) and better Database connectivity. And its stable version is Version 5.2.1 is released on February 8, 2007. Now day’s latest version is 5.3.0. This is also actively supported by browsers and updates.</li>
</ol>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><em><strong>And Version 6.0 is on the way for release when this article was written. Still not released this version. </strong></em></p>
<p><em><span style="color: #0000ff;"><br />
</span></em></p>
<p><em><span style="color: #0000ff;">Me going to teach you every tutorial on PHP version 5.2.5 or more and its equally work on others too, And I think now you some better understanding of PHP versions. </span></em></p>
<p style="text-align: center;"><span style="color: #ff0000;"><strong><span style="font-size: x-large;">Features Of PHP </span></strong></span></p>
<p style="text-align: center;"><span style="color: #ff0000;"><strong><span style="font-size: x-large;"><br />
</span></strong></span></p>
<p>Just take a look now what are the features of PHP and why we use PHP:</p>
<ul>
<li>PHP is any open source. Open source mean source code is available for everyone to study to use and to modify.</li>
<li>PHP is free software mean free to download and use.</li>
<li>PHP is a cross platform to develop. Cross platform mean we can run PHP on different platform (Windows, Linux, Mac, UNIX, etc.)</li>
<li>PHP is compatible with almost all servers used today (Apache, IIS, etc.).</li>
<li>PHP is also Powerful, Robust, scalable.</li>
<li> PHP is a Web Development Specific. Its mean it’s written from the beginning with web development mind. Version 1 was written for help to maintain their personal website.</li>
<li>PHP is an Object Oriented Programming, Commonly known as OOP especially Version 5.</li>
<li>Having great Documentation in many different languages.(www.php.net/docs.php)</li>
<li>PHP is easy to learn and runs efficiently on the server side.</li>
<li>Large  active developer community, Run more than 20 million websites on PHP and its 4th most popular programming language behind  JAVA , C and C++.</li>
<li>So many great examples of PHP application like WordPress, Joomla, Mambo, PHPbb, and Mediawiki and all these are free to downalod for maintain your websites, blogs, boards, forums.</li>
</ul>
<p style="text-align: center;"><strong><span style="font-size: x-large;"><span style="color: #ff0000;"> Installation </span></span></strong></p>
<p><strong><span style="font-size: x-large;"><br />
</span></strong></p>
<p><span style="font-size: small;">F</span>or installing PHP completely you need few things:</p>
<ol>
<li><span style="color: #ff0000;">Web server (Apache 1.3) </span></li>
<li><span style="color: #ff0000;"> PHP (Version 5.2.5) </span></li>
<li><span style="color: #ff0000;">Database (My SQL 5.0) </span></li>
<li><span style="color: #ff0000;">Text Editor (Notepad or any other like TextMate) </span></li>
<li><span style="color: #ff0000;"> Web Browser (Firefox) </span></li>
</ol>
<p>Either You Can Install all these software’s separately or uses single Software for installing all these. Download all these software’s separately from here and these are totally free:</p>
<p><span style="color: #0000ff;"><strong><br />
</strong></span></p>
<p><span style="color: #0000ff;"><strong>Download PHP: </strong></span></p>
<p><a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a></p>
<p><strong><span style="color: #0000ff;"><br />
</span></strong></p>
<p><strong><span style="color: #0000ff;">Download My SQL Database:</span></strong></p>
<p><a href="http://www.mysql.com/downloads/index.html">http://www.mysql.com/downloads/index.html</a></p>
<p><strong><span style="color: #0000ff;"><br />
</span></strong></p>
<p><strong><span style="color: #0000ff;">Download Apache Server: </span></strong></p>
<p><a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a></p>
<p>Here I ‘m not going to teach how to install, for instruction takes a look here:</p>
<p><a href="http://www.php.net/manual/en/install.php">http://www.php.net/manual/en/install.php</a></p>
<p><strong><br />
</strong></p>
<p><strong>And IF you want to use a single software for all these then you use : </strong></p>
<ul>
<li><span style="color: #0000ff;">Lamp (for Linux) </span></li>
<li><span style="color: #0000ff;">Mamp (for MAC) </span></li>
<li><span style="color: #0000ff;">Wamp (For Windows)</span></li>
<li><span style="color: #0000ff;"> XAMPP (For Windows) </span></li>
</ul>
<p><span style="color: #0000ff;"><br />
</span></p>
<p>Either Google it for installing these software’s or use this I found some links:</p>
<p><span style="color: #0000ff;"><strong><br />
</strong></span></p>
<p><span style="color: #0000ff;"><strong> Lamp: </strong></span></p>
<p><a href="http://www.sph.umich.edu/csg/abecasis/LAMP/download">http://www.sph.umich.edu/csg/abecasis/LAMP/download</a></p>
<p><span style="color: #0000ff;"><strong>or</strong></span></p>
<p><a href="http://sourceforge.net/project/showfiles.php?group_id=16216">http://sourceforge.net/project/showfiles.php?group_id=16216</a></p>
<p><span style="color: #0000ff;"><strong>Mamp:</strong></span> <a href="http://www.mamp.info/en/download.html">http://www.mamp.info/en/download.html</a></p>
<p><span style="color: #0000ff;"><strong>Wamp:</strong></span> <a href="http://www.wampserver.com/en/download.php">http://www.wampserver.com/en/download.php</a></p>
<p><span style="color: #0000ff;"><strong>Xampp:</strong></span> <a href="http://www.apachefriends.org/en/xampp-windows.html">http://www.apachefriends.org/en/xampp-windows.html</a></p>
<p><strong><span style="color: #ff0000;"><br />
</span></strong></p>
<p><span style="color: #0000ff;"><strong><br />
</strong></span></p>
<p><strong>To be Continue in Next Edition …. </strong></p>
<p><span style="color: #008000;"><strong>Thanks, </strong></span></p>
<p><span style="color: #008000;"><strong>Tutorials By: Manan Saini </strong></span></p>
<p><span style="color: #008000;"><strong>Join us: www.logicmatters.org</strong></span></p>



If you like it, then why not share with others and bookmark it :


	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;partner=sociable" title="Print"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&amp;bodytext=Hello%20Friends%2C%0D%0APart%20one%20is%20not%20a%20video%20tutorial%20so%20only%20documentation%20rest%20all%20other%20has%20video%20tutorials.%0D%0AWell%20all%20of%20you%20know%20about%20web%20languages%2C%20there%20are%20so%20many%20languages%20now%20days.%20For%20a%20good%20website%20design%20you%20must%20have%20a%20good%20knowledge%20of%20an" title="Digg"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction" title="Sphinn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&amp;notes=Hello%20Friends%2C%0D%0APart%20one%20is%20not%20a%20video%20tutorial%20so%20only%20documentation%20rest%20all%20other%20has%20video%20tutorials.%0D%0AWell%20all%20of%20you%20know%20about%20web%20languages%2C%20there%20are%20so%20many%20languages%20now%20days.%20For%20a%20good%20website%20design%20you%20must%20have%20a%20good%20knowledge%20of%20an" title="del.icio.us"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;t=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="Facebook"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="Mixx"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&amp;annotation=Hello%20Friends%2C%0D%0APart%20one%20is%20not%20a%20video%20tutorial%20so%20only%20documentation%20rest%20all%20other%20has%20video%20tutorials.%0D%0AWell%20all%20of%20you%20know%20about%20web%20languages%2C%20there%20are%20so%20many%20languages%20now%20days.%20For%20a%20good%20website%20design%20you%20must%20have%20a%20good%20knowledge%20of%20an" title="Google Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.blogospherenews.com/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="Blogosphere News"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogospherenews.png" title="Blogosphere News" alt="Blogosphere News" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&amp;body=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction" title="email"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://internetmedia.hu/submit.php?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction" title="Internetmedia"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/im.png" title="Internetmedia" alt="Internetmedia" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&amp;source=Logic+Matters%21+Free+Video+Tutorials+%E2%80%93+PHP%2CFlash%2CPhotoshop%2CSEO%2CWebsite+Designing%2CRobotics%2CC%2CC%2B%2B+%E2%80%A6+&amp;summary=Hello%20Friends%2C%0D%0APart%20one%20is%20not%20a%20video%20tutorial%20so%20only%20documentation%20rest%20all%20other%20has%20video%20tutorials.%0D%0AWell%20all%20of%20you%20know%20about%20web%20languages%2C%20there%20are%20so%20many%20languages%20now%20days.%20For%20a%20good%20website%20design%20you%20must%20have%20a%20good%20knowledge%20of%20an" title="LinkedIn"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="Live"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reporter.nl.msn.com/?fn=contribute&amp;Title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&amp;URL=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;cat_id=6&amp;tag_id=31&amp;Remark=Hello%20Friends%2C%0D%0APart%20one%20is%20not%20a%20video%20tutorial%20so%20only%20documentation%20rest%20all%20other%20has%20video%20tutorials.%0D%0AWell%20all%20of%20you%20know%20about%20web%20languages%2C%20there%20are%20so%20many%20languages%20now%20days.%20For%20a%20good%20website%20design%20you%20must%20have%20a%20good%20knowledge%20of%20an" title="MSN Reporter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/msnreporter.png" title="MSN Reporter" alt="MSN Reporter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;t=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="MySpace"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;partner=sociable" title="PDF"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.sphere.com/search?q=sphereit:http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="SphereIt"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/sphere.png" title="SphereIt" alt="SphereIt" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="StumbleUpon"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction" title="Technorati"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D%20-%20http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction" title="Twitter"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;t=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&opener=bm&amp;ei=UTF-8&amp;d=Hello%20Friends%2C%0D%0APart%20one%20is%20not%20a%20video%20tutorial%20so%20only%20documentation%20rest%20all%20other%20has%20video%20tutorials.%0D%0AWell%20all%20of%20you%20know%20about%20web%20languages%2C%20there%20are%20so%20many%20languages%20now%20days.%20For%20a%20good%20website%20design%20you%20must%20have%20a%20good%20knowledge%20of%20an" title="Yahoo! Bookmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;submitHeadline=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D&amp;submitSummary=Hello%20Friends%2C%0D%0APart%20one%20is%20not%20a%20video%20tutorial%20so%20only%20documentation%20rest%20all%20other%20has%20video%20tutorials.%0D%0AWell%20all%20of%20you%20know%20about%20web%20languages%2C%20there%20are%20so%20many%20languages%20now%20days.%20For%20a%20good%20website%20design%20you%20must%20have%20a%20good%20knowledge%20of%20an&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.lmtutorials.com/feed" title="RSS"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http%3A%2F%2Fwww.lmtutorials.com%2Fphp-tutorial-part-1-introduction&amp;title=PHP%20Tutorial%20Part%201%20%5B%20Introduction%20%5D" title="blogmarks"><img src="http://www.lmtutorials.com/wp-content/plugins/sociable/images/blogmarks.png" title="blogmarks" alt="blogmarks" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.lmtutorials.com/php-tutorial-part-1-introduction/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

