<?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>George Phillips Web Development</title>
	<atom:link href="http://www.georgephillips.co.uk/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.georgephillips.co.uk/wordpress</link>
	<description>My name is George Phillips and I am a Web Developer</description>
	<lastBuildDate>Tue, 13 Mar 2012 10:01:52 +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>HTML5 &#8211; Doctype</title>
		<link>http://www.georgephillips.co.uk/wordpress/html5/html5-doctype/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/html5/html5-doctype/#comments</comments>
		<pubDate>Thu, 16 Feb 2012 08:24:53 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=123</guid>
		<description><![CDATA[The new HTML5 Doctype is &#60;!DOCTYPE HTML&#62; That&#8217;s it!]]></description>
			<content:encoded><![CDATA[<p>The new HTML5 Doctype is <code>&lt;!DOCTYPE HTML&gt;</code></p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/html5/html5-doctype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Operators</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-operators/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-operators/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 14:23:01 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=116</guid>
		<description><![CDATA[Operator Discription Example Arithmatic Basic Maths $a + $b Array Array Union $a + $b Assignment Assign Values $a = $b + 36 Bitwise Manipulates bits within bytes 12 ^ 9 Comparison Compares two values $a &#60; &#038;b Execution Executes contents of back ticks '1s -a1' Increment/Decrement Add or Subtract 1 $a++ Logical Boolean $a [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>Operator</td>
<td>Discription</td>
<td>Example</td>
</tr>
<tr>
<td>Arithmatic</td>
<td>Basic Maths</td>
<td><code>$a + $b</code></td>
</tr>
<tr>
<td>Array</td>
<td>Array Union</td>
<td><code>$a + $b</code></td>
</tr>
<tr>
<td>Assignment</td>
<td>Assign Values</td>
<td><code>$a = $b + 36</code></td>
</tr>
<tr>
<td>Bitwise</td>
<td>Manipulates bits within bytes</td>
<td><code>12 ^ 9</code></td>
</tr>
<tr>
<td>Comparison</td>
<td>Compares two values</td>
<td><code>$a &lt; &#038;b</code></td>
</tr>
<tr>
<td>Execution</td>
<td>Executes contents of back ticks</td>
<td><code>'1s -a1'</code></td>
</tr>
<tr>
<td>Increment/Decrement</td>
<td>Add or Subtract 1</td>
<td><code>$a++</code></td>
</tr>
<tr>
<td>Logical</td>
<td>Boolean</td>
<td><code>$a and $b</td>
</tr>
<tr>
<td>String</td>
<td>Concatenation</td>
<td>$a . $b</td>
</tr>
</table>
<p>Operators take a different number of operands.</p>
<p>Unary operators <code>($a++)</code> or <code>(-$a)</code> take a single operand.<br />
Binary operators take two <code>($a + $b)</code> etc.<br />
One Ternary which is <code>? x : y</code></p>
<p>Precedence (High - Low)</p>
<p>Operators</p>
<table>
<tr>
<td><code>()</code></td>
<td>Parentheses</td>
</tr>
<tr>
<td><code>++ --</code></td>
<td>Increment/Decrement</td>
</tr>
<tr>
<td><code>!</code></td>
<td>Logical</td>
</tr>
<tr>
<td><code>* / %</code></td>
<td>Arithmetic</td>
</tr>
<tr>
<td><code>+ - .</code></td>
<td>Arithmetic and String</td>
</tr>
<tr>
<td><code>&lt;&lt; &gt;&gt;</code></td>
<td>Bitwise</td>
</tr>
<tr>
<td><code>&lt; &lt;= &gt;= &gt;</code></td>
<td>Comparison</td>
</tr>
<tr>
<td><code>== != === !==</code></td>
<td>Comparison</td>
</tr>
<tr>
<td><code>&amp;</code></td>
<td>Bitwise (and reference)</td>
</tr>
<tr>
<td><code>^</code></td>
<td>Bitwise</td>
</tr>
<tr>
<td><code>|</code></td>
<td>Logical</td>
</tr>
<tr>
<td><code>&amp;&amp;</code></td>
<td>Logical</td>
</tr>
<tr>
<td><code>||</code></td>
<td>Logical</td>
</tr>
<tr>
<td><code>? :</code></td>
<td>Ternary</td>
</tr>
<tr>
<td><code>= += -= *= /= %= &amp;= != ^= &lt;&lt;= &gt;&gt;=</code></td>
<td>Assignment</td>
</tr>
<tr>
<td><code>and</code></td>
<td>Logical</td>
</tr>
<tr>
<td><code>xor</code></td>
<td>Logical</td>
</tr>
<tr>
<td><code>or</code></td>
<td>Logical</td>
</tr>
</table>
<p>These are left to right except where operator precedence is in effect. So go right to left. The direction of processing is called  associativity.</p>
<p>Operators with right to left associativity:</p>
<p>Operator</p>
<table>
<tr>
<td><code>NEW</code></td>
<td>Create a new objects</td>
</tr>
<tr>
<td><code>!</code></td>
<td>Logical NOT</td>
</tr>
<tr>
<td><code>~</code></td>
<td>Bitwise NOT</td>
</tr>
<tr>
<td><code>++ --</code></td>
<td>Increment and decrement</td>
</tr>
<tr>
<td><code>+ -</code></td>
<td>Unary and negation</td>
</tr>
<tr>
<td><code>(int)</code></td>
<td>Cast to an integer</td>
</tr>
<tr>
<td><code>(double)</code></td>
<td>Cast to a float</td>
</tr>
<tr>
<td><code>(string)</code></td>
<td>Cast to a string</td>
</tr>
<tr>
<td><code>(array)</code></td>
<td>Cast to an array</td>
</tr>
<tr>
<td><code>(object)</code></td>
<td>Cast to an object</td>
</tr>
<tr>
<td><code>@</code></td>
<td>Inhabit error reporting</td>
</tr>
<tr>
<td><code>? :</code></td>
<td>Conditional</td>
</tr>
<tr>
<td><code>=</code></td>
<td>Assignment</td>
</tr>
</table>
<p>For example, lets look at the assignment separator where all three variables are set to 0.</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;$level = $score = $time = 0<br />
?&gt;<br /></code><br />
<br />
Multiple assignment is possible only if the right hard part of the expression is evaluated first, then processing continues right to left.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Literals &amp; Variables</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/literals-variables/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/literals-variables/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 12:44:34 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=105</guid>
		<description><![CDATA[The simplest form of expression is a literal which means something that evaluates to itself. An expression can also be a variable, which evaluates to the value that&#8217;s been assigned to it. &#60;?php &#160;&#160;$myname = "George"; &#160;&#160;$myage = 27; &#160;&#160;echo "a: " . 73 &#160;&#160;&#160;&#160;&#160;. " &#60;br /&#62;" // Numeric literal &#160;&#160;echo "b: " . [...]]]></description>
			<content:encoded><![CDATA[<p>The simplest form of expression is a literal which means something that evaluates to itself. An expression can also be a variable, which evaluates to the value that&#8217;s been assigned to it.</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;$myname = "George";<br />
&nbsp;&nbsp;$myage = 27;<br />
&nbsp;&nbsp;echo "a: " . 73 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. " &lt;br /&gt;" // Numeric literal<br />
&nbsp;&nbsp;echo "b: " . "Hello" . " &lt;br /&gt;" // String literal<br />
&nbsp;&nbsp;echo "c: " . FALSE &nbsp;&nbsp;. " &lt;br /&gt;" // Boolean literal<br />
&nbsp;&nbsp;echo "d: " . $myname . " &lt;br /&gt;" // Variable string literal<br />
&nbsp;&nbsp;echo "e: " . $myage &nbsp;. " &lt;br /&gt;" // Variable numeric literal<br />
?&gt;</code></p>
<p>These return:<br />
a: 73<br />
b: Hello<br />
c: // false so nothing<br />
d: George<br />
e: 27</p>
<p>In conjunction with operators, it&#8217;s possible to create more complex expressions that evaluate to useful results&#8230;</p>
<p>When you combine assignment of control-flow constructs with expressions, the result is a statement.</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;$daysToNewYear = 366 - $dayNumber ; // Expression<br />
&nbsp;&#038;nbsp:&nbsp;&nbsp; if ($daysToNewYear &lt; 30 )<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo "Not long to go now until new year!"; //Statement<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
?&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/literals-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Expressions</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-expressions/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-expressions/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 11:34:24 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=101</guid>
		<description><![CDATA[An expression is a combination of values, variables, operators and functions that results in a value. y = 3(abs(2x) + 4) In PHP &#160;&#160;$y = 3 * (abs(2 * $x) + 4); The value returned (y or $y in this case) can be a number, string or a Boolean value. Boolean is TRUE or FALSE, [...]]]></description>
			<content:encoded><![CDATA[<p>An expression is a combination of values, variables, operators and functions that results in a value.</p>
<p>y = 3(abs(2x) + 4)</p>
<p>In PHP<br />
<br />
<code>&nbsp;&nbsp;$y = 3 * (abs(2 * $x) + 4);</code></p>
<p>The value returned (y or $y in this case) can be a number, string or a Boolean value.</p>
<p>Boolean is TRUE or FALSE, 5 == 6 is FALSE</p>
<p>Uppercase Booleans can be redefined. Lowercase cannot.</p>
<p>Some booleans:</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;echo "a : [" . ( 20 &lt; 9 ) . "] &lt;br /&gt;",<br />
&nbsp;&nbsp;echo "b : [" . ( 5 == 6 ) . "] &lt;br /&gt;",<br />
&nbsp;&nbsp;echo "c : [" . ( 1 == 0 ) . "] &lt;br /&gt;",<br />
&nbsp;&nbsp;echo "d : [" . ( 1 == 1 ) . "] &lt;br /&gt;",<br />
?&gt;</code></p>
<p>The output of this code would be: </p>
<p>a: [1] <br />
b: [] <br />
c: [] <br />
d: [1] </p>
<p>Notice that both expressions a and d evaluate to true, which has a value of 1. But b &amp; c evaluated to false don&#8217;t show anything because PHP FALSE is defined as NULL or nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Variable Scope</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-variable-scope/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-variable-scope/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 11:13:48 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=95</guid>
		<description><![CDATA[Local variables are created in and used inside a function, they can only be accessed by the same function. Global variables can be called by any function. All your code can access them. Static Variables can be sued to keep track of how many times a function has been called. It&#8217;s contents are not wiped [...]]]></description>
			<content:encoded><![CDATA[<p>Local variables are created in and used inside a function, they can only be accessed by the same function.</p>
<p>Global variables can be called by any function. All your code can access them.</p>
<p>Static Variables can be sued to keep track of how many times a function has been called. It&#8217;s contents are not wiped when the function has ended unlike a local variable.</p>
<p>Superglobal variables are predefined variables and contain lots of useful information about the current running program and it&#8217;s environment.</p>
<p>Superglobals are often used by hackers trying to find exploits to break into your website. You should always sanitise superglobals before using them&#8230; the <code>htmlentities</code> function is a good way to do this.</p>
<p><code>&nbsp;&nbsp;$came_from = htmlentities( $_SERVER['HTTP_REFERRER'] );</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-variable-scope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Functions</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-functions/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-functions/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 11:06:20 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=93</guid>
		<description><![CDATA[Functions are declared like so: &#60;?php &#160;&#160;function longdate($timestamp) &#160;&#160;{ &#160;&#160;&#160;&#160;return date("l F jS Y", $timestamp); &#160;&#160;} ?> To output today&#8217;s date with this function, place the following in your code: &#160;&#160;echo longdate( time() ); This call uses the built in PHP time function to fetch the current unix timestamp and passes it the the new [...]]]></description>
			<content:encoded><![CDATA[<p>Functions are declared like so:</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;function longdate($timestamp)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;return date("l F jS Y", $timestamp);<br />
&nbsp;&nbsp;}<br />
?></code></p>
<p>To output today&#8217;s date with this function, place the following in your code:</p>
<p><code>&nbsp;&nbsp;echo longdate( time() );</code><br />
<bt /><br />
This call uses the built in PHP time function to fetch the current unix timestamp and passes it the the new longdate function, which returns the appropriate string the the echo command for display.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Echo vs. Print</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-echo-vs-print/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-echo-vs-print/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 10:52:49 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=90</guid>
		<description><![CDATA[Print is like echo but it can be used in more complex functions. &#160;&#160;$b ? print "TRUE" : print "FALSE";]]></description>
			<content:encoded><![CDATA[<p>Print is like echo but it can be used in more complex functions. </p>
<p><code>&nbsp;&nbsp;$b ? print "TRUE" : print "FALSE";</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-echo-vs-print/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Constants</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-constants/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-constants/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 10:48:39 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=87</guid>
		<description><![CDATA[Constants are similar to variables except they are immutable. One you have defined one it&#8217;s value is set for the rest of the program and cannot be changed. One example for a constant might be to hold the location of your server root (containing the files of your website) like this: &#160;&#160;define("ROOT_LOCATION", "/user/local/www/"); To read [...]]]></description>
			<content:encoded><![CDATA[<p>Constants are similar to variables except they are immutable. One you have defined one it&#8217;s value is set for the rest of the program and cannot be changed.</p>
<p>One example for a constant might be to hold the location of your server root (containing the files of your website) like this: </p>
<p><code>&nbsp;&nbsp;define("ROOT_LOCATION", "/user/local/www/");</code></p>
<p>To read it&#8217;s contents you refer to it like a variable (but it isn&#8217;t proceeded by the $):</p>
<p><code>&nbsp;&nbsp;$directory = ROOT_LOCATION;</code></p>
<p>Now when you need to run your code on a different server, you only need to change one line of code.</p>
<p>Use uppercase for constants. It&#8217;s good practice. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-constants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Loosely Typed</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-loosely-typed/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-loosely-typed/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 10:37:00 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=85</guid>
		<description><![CDATA[Like the headline says, PHP is loosely typed like JavaScript.]]></description>
			<content:encoded><![CDATA[<p>Like the headline says, PHP is loosely typed like JavaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-loosely-typed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Multiple Line Commands</title>
		<link>http://www.georgephillips.co.uk/wordpress/php/php-multiple-line-commands/</link>
		<comments>http://www.georgephillips.co.uk/wordpress/php/php-multiple-line-commands/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 10:22:23 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.georgephillips.co.uk/wordpress/?p=78</guid>
		<description><![CDATA[There are times when you need to output quite a lot of text and multiple echo statements would be messy and time consuming. There are two ways to combat this. The first is to just put multiple line in quotes. Variables can also be assigned. &#60;?php &#160;&#160;$author = "George Phillips"; &#160;&#160;echo "This is a Headline [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you need to output quite a lot of text and multiple echo statements would be messy and time consuming. There are two ways to combat this.<br />
The first is to just put multiple line in quotes. Variables can also be assigned.</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;$author = "George Phillips";</p>
<p>&nbsp;&nbsp;echo "This is a Headline</p>
<p>&nbsp;&nbsp;This is line one<br />
&nbsp;&nbsp;This is line two<br />
&nbsp;&nbsp;Written by $author." ;<br />
?&gt;</code></p>
<p>Or</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;$author = "George Phillips";</p>
<p>&nbsp;&nbsp;$text = "This is a Headline</p>
<p>&nbsp;&nbsp;This is line one<br />
&nbsp;&nbsp;This is line two<br />
&nbsp;&nbsp;Written by $author.";<br />
?&gt;</code></p>
<p>PHP also offers a multiline sequence using the <code>&lt;&lt;&lt;</code> operator commonly referred to as <code>here-document</code> or <code>heredoc</code> for short.</p>
<p><code>&lt;?php<br />
&nbsp;&nbsp;$author = "George Phillips";</p>
<p>&nbsp;&nbsp;echo &lt;&lt;&lt;_END<br />
&nbsp;&nbsp;This is a headline</p>
<p>&nbsp;&nbsp;Line one.<br />
&nbsp;&nbsp;Line two.<br />
&nbsp;&nbsp;Written by $author.</p>
<p>&nbsp;&nbsp;_END;<br />
?&gt;</code></p>
<p>This outputs everything between the <code>_END</code> tag if it were a double quoted string. So you can write entire sections of HTML in PHP code and just replace specific dynamic posts with PHP variables.</p>
<p>The closing <code>_END;</code> tag <em>MUST</em> appear right at the start of a new line and the only thing on the line. Not ever a comment is allowed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.georgephillips.co.uk/wordpress/php/php-multiple-line-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

