<?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>Still Learning... &#187; php</title>
	<atom:link href="http://andyanglea.com/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyanglea.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 03 Jul 2011 20:00:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>if problems</title>
		<link>http://andyanglea.com/blog/2009/08/if-problems/</link>
		<comments>http://andyanglea.com/blog/2009/08/if-problems/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 12:35:44 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://andyanglea.com/blog/?p=111</guid>
		<description><![CDATA[This is definitely one for the geek files, so if multi-condition PHP if statements mean nothing to you, feel free to move along.  I won&#8217;t be offended. Ok, just geeks left?  Good, here we go. Last night I was trying to correct a syntax error and came across a helpful way to determine if all [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is definitely one for the geek files, so if multi-condition PHP if statements mean nothing to you, feel free to move along.  I won&#8217;t be offended.</p>
<p>Ok, just geeks left?  Good, here we go.</p>
<p>Last night I was trying to correct a syntax error and came across a helpful way to determine if all the parentheses in my if statement matched each other.  Basically how it works is like this.  Start counting each parenthesis in your statement. Each time you see an open parenthesis you increase your count by 1 and each time you see a close parenthesis you decrease your count by 1.  Let me illustrate:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// 12                 1    23   4           3      2    3      4                3210</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$condition1</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>len<span style="color: #009900;">&#40;</span><span style="color: #000088;">$condition2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></div></div>

<p>Don&#8217;t know if that helps you or not, but as the editor i was using (online) didn&#8217;t have a syntax checker, it helped me a great deal.</p>
<p><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fandyanglea.com%2Fblog%2F2009%2F08%2Fif-problems%2F&amp;linkname=if%20problems" title="Twitter" rel="nofollow" target="_blank"><img src="http://andyanglea.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fandyanglea.com%2Fblog%2F2009%2F08%2Fif-problems%2F&amp;linkname=if%20problems" title="Delicious" rel="nofollow" target="_blank"><img src="http://andyanglea.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fandyanglea.com%2Fblog%2F2009%2F08%2Fif-problems%2F&amp;linkname=if%20problems" title="Facebook" rel="nofollow" target="_blank"><img src="http://andyanglea.com/blog/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fandyanglea.com%2Fblog%2F2009%2F08%2Fif-problems%2F&amp;title=if%20problems" id="wpa2a_2"><img src="http://andyanglea.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://andyanglea.com/blog/2009/08/if-problems/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

