<?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>webinfinite.com &#187; switch statment</title>
	<atom:link href="http://webinfinite.com/tag/switch-statment/feed/" rel="self" type="application/rss+xml" />
	<link>http://webinfinite.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Jun 2010 16:26:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Switch Statement</title>
		<link>http://webinfinite.com/php/switch-statement/</link>
		<comments>http://webinfinite.com/php/switch-statement/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 23:44:19 +0000</pubDate>
		<dc:creator>webinfinite</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[switch statment]]></category>

		<guid isPermaLink="false">http://webinfinite.com/?p=113</guid>
		<description><![CDATA[A PHP switch statement is almost like an IF statement except it is good to use a switch statement when you want to compare many results on the same variable. Example with integer. &#60;?php switch?($i): case 0: echo "i = 0"; break; case 1: echo "i = 1"; break; case 2: echo "i = 2"; [...]]]></description>
			<content:encoded><![CDATA[<p>A PHP switch statement is almost like an IF statement except it is good to use a switch statement when you want to compare many results on the same variable.</p>
<p>Example with integer.</p>
<div class="informalexample">
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000;"> <span style="color: #0000bb;">&lt;?php<br />
</span><span style="color: #007700;">switch?(</span><span style="color: #0000bb;">$i</span><span style="color: #007700;">):<br />
case </span><span style="color: #0000bb;">0</span><span style="color: #007700;">:<br />
echo </span><span style="color: #dd0000;">"i = 0"</span><span style="color: #007700;">;<br />
break;<br />
case </span><span style="color: #0000bb;">1</span><span style="color: #007700;">:<br />
echo </span><span style="color: #dd0000;">"i = 1"</span><span style="color: #007700;">;<br />
break;<br />
case </span><span style="color: #0000bb;">2</span><span style="color: #007700;">:<br />
echo </span><span style="color: #dd0000;">"i = 2"</span><span style="color: #007700;">;<br />
break;<br />
default:<br />
echo </span><span style="color: #dd0000;">"i?is?not?equal?to?0,?1?or?2"</span><span style="color: #007700;">;<br />
endswitch;<br />
</span><span style="color: #0000bb;">?&gt;</span> </span> </code></div>
</div>
</div>
<p>Example with a string.</p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000;"> <span style="color: #0000bb;">&lt;?php<br />
</span><span style="color: #007700;">switch?(</span><span style="color: #0000bb;">$i</span><span style="color: #007700;">)?{<br />
case </span><span style="color: #dd0000;">"eagle</span><span style="color: #007700;">:<br />
echo </span><span style="color: #dd0000;">"i?is eagle"</span><span style="color: #007700;">;<br />
break;<br />
case </span><span style="color: #dd0000;">"hawk"</span><span style="color: #007700;">:<br />
echo </span><span style="color: #dd0000;">"i?is hawk"</span><span style="color: #007700;">;<br />
break;<br />
case </span><span style="color: #dd0000;">"blue jay"</span><span style="color: #007700;">:<br />
echo </span><span style="color: #dd0000;">"i?is blue jay"</span><span style="color: #007700;">;<br />
break;<br />
}<br />
</span><span style="color: #0000bb;">?&gt;</span></span></code></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://webinfinite.com/php/switch-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
