<?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>The Tutorial Blog &#187; if</title>
	<atom:link href="http://www.thetutorialblog.com/tag/if/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetutorialblog.com</link>
	<description></description>
	<lastBuildDate>Wed, 07 Jul 2010 23:30:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
<link>http://www.thetutorialblog.com</link>
<url>http://www.thetutorialblog.com/wp-content/plugins/maxblogpress-favicon/icons/favicon-28.ico</url>
<title>The Tutorial Blog</title>
</image>
		<item>
		<title>PHP One Line IF Statement</title>
		<link>http://www.thetutorialblog.com/php/php-one-line-if-statement/</link>
		<comments>http://www.thetutorialblog.com/php/php-one-line-if-statement/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 22:31:31 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[else]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[quicktip]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=35</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	I'm sure if you've been programming for a few years that you've come across when you need to check if something equals something than do something else a few times. Well the best way to do this is like so. Say for example we have a variable called $num and the value of it is [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-one-line-if-statement%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fphp%2Fphp-one-line-if-statement%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="PHP One Line IF Statement" alt=" PHP One Line IF Statement" /><br />
			</a>
		</div>
<p>I'm sure if you've been programming for a few years that you've come across when you need to check if something equals something than do something else a few times.</p>
<p>Well the best way to do this is like so.</p>
<p>Say for example we have a variable called $num and the value of it is 5.<br />
<span id="more-35"></span><br />
You could store it in a variable.<br />
<div id="code_div">$code = ($num &gt; 0) ? "More than 0" : "Less than 0";</div></p>
<p>or you could print it straight to the users browsers<br />
<div id="code_div">echo ($num &gt; 0) ? "More than 0": "Less than 0";</div></p>
<p>So what happens here is if $num is greater than 0 print More than 0 else print Less than 0.</p>
<p>I hope you've found this quick tip helpful and use it throughout future projects.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/php/php-one-line-if-statement/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
