<?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>Marc Fraser &#124; A Blog about all things &#187; php conditional statement</title>
	<atom:link href="http://www.marcfraser.co.uk/tag/php-conditional-statement/feed" rel="self" type="application/rss+xml" />
	<link>http://www.marcfraser.co.uk</link>
	<description>A blog about all things personal, web related.</description>
	<lastBuildDate>Fri, 23 Apr 2010 13:50:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP IF Statement</title>
		<link>http://www.marcfraser.co.uk/php-if-statement-60.htm</link>
		<comments>http://www.marcfraser.co.uk/php-if-statement-60.htm#comments</comments>
		<pubDate>Sat, 10 Oct 2009 10:31:41 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[php conditional statement]]></category>
		<category><![CDATA[php if]]></category>
		<category><![CDATA[php if statement]]></category>

		<guid isPermaLink="false">http://marcfraser.co.uk/?p=60</guid>
		<description><![CDATA[(from Full Article)
In PHP IF statements are extensively used.  It allows you to show the user data depending on certain conditions. The best way to describe it is with the use of an example: You want to build a dashboard with items you do not want all employees to see, this is where IF statements [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em><strong><em></em></strong></em></strong><strong><em><strong><em><a href="../introduction-to-php-tutorial-9.htm">(from Full Article)</a></em></strong></em></strong></p>
<p>In PHP <a href="http://us.php.net/manual/en/control-structures.if.php">IF statements</a> are extensively used.  It allows you to show the user data depending on certain conditions. The best way to describe it is with the use of an example: You want to build a dashboard with items you do not want all employees to see, this is where IF statements come in handy – you can check that they are a certain person or a member of a certain group and if this is true the employee can see the item, if it is false (the employee isn’t in the necessary group) then the employee shouldn’t see the items.</p>
<p>We will use <em>Comparison Operators </em>in the example below;</p>
<pre class="brush: php;">&lt;?php

$isManagement = false;

if($isManagement == true) {

// Show the data that you wish only management to see.

} else {

// You are not management and so cannot see this data.

}

?&gt;</pre>
<p>The above example uses comments to show how the if statement works in terms of the example farther above. $isManagement will come from the employees record.</p>
<p>Within the IF() statement we are comparing to see if $isManagement is true, within the first parenthesis ({}) is where the PHP code will go if the result is true. The else statement is included to catch all other occurrences apart from the true occurrences. Please see the <a href="http://us.php.net/manual/en/control-structures.else.php">PHP Manual</a> for another example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcfraser.co.uk/php-if-statement-60.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
