<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Personal Blog of Matt Rawcliffe</title>
	<atom:link href="http://rawcliffe.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rawcliffe.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 27 Dec 2010 08:00:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rawcliffe.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Personal Blog of Matt Rawcliffe</title>
		<link>http://rawcliffe.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rawcliffe.wordpress.com/osd.xml" title="Personal Blog of Matt Rawcliffe" />
	<atom:link rel='hub' href='http://rawcliffe.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Function</title>
		<link>http://rawcliffe.wordpress.com/2007/11/20/function/</link>
		<comments>http://rawcliffe.wordpress.com/2007/11/20/function/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 18:12:19 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://rawcliffe.wordpress.com/2007/11/20/function/</guid>
		<description><![CDATA[When you have a set of variables or want to make your code simpler, you will use a function. Creating a function is really easy all you have to do is write something like: function myFunctionName() { //Function data } Now if you have a look at the code above, where it says myFunctionName(), you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=12&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you have a set of variables or want to make your code simpler, you will use a function. Creating a function is really easy all you have to do is write something like:</p>
<blockquote><p>function myFunctionName() {<br />
//Function data<br />
}</p></blockquote>
<p><span id="more-12"></span><br />
Now if you have a look at the code above, where it says <strong>myFunctionName()</strong>, you can also add some parameters in between the <strong>( )</strong> brackets in case you want some special parameters to be used in the function.</p>
<p>Now we will take a short look at writing a simple function. In the following example, we will take a look at using a special parameter to write out a special string.</p>
<blockquote><p>function writeString($string) {<br />
echo $string;<br />
}</p></blockquote>
<p>Now, to call this function, you just use the very simple code:</p>
<blockquote><p>writeString(&#8220;Hello, world!&#8221;);</p></blockquote>
<p>Now that would return the following:</p>
<blockquote><p>Hello, world!</p></blockquote>
<p>Of course, you could also set a variable earlier on in the script and then just put <strong>$variable-name</strong> between the two brackets.</p>
<p>Of course, you could always add a more complicated things in the function, for example use other functions to reduce the amount of coding you have to do later on. Alternitavely, just jump on over to <a href="http://pear.php.net">PEAR PHP</a> and you&#8217;ll find loads of pre-written functions and classes so you don&#8217;t have to.</p>
<p>If you think I have missed anything out, just drop me a comment,</p>
<p>Thanks for reading,</p>
<p>Matt</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rawcliffe.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rawcliffe.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rawcliffe.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rawcliffe.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rawcliffe.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rawcliffe.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rawcliffe.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rawcliffe.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rawcliffe.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rawcliffe.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rawcliffe.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rawcliffe.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rawcliffe.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rawcliffe.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rawcliffe.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rawcliffe.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=12&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rawcliffe.wordpress.com/2007/11/20/function/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e037766a838634d1118bfbf3934651ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Config File</title>
		<link>http://rawcliffe.wordpress.com/2007/11/19/config-file/</link>
		<comments>http://rawcliffe.wordpress.com/2007/11/19/config-file/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 22:02:26 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://rawcliffe.wordpress.com/2007/11/19/config-file/</guid>
		<description><![CDATA[This is just an example of a config file which connects to a database for those who need it: DEFINE (&#8216;DB_USER&#8217;, &#8216;username&#8217;); DEFINE (&#8216;DB_PASSWORD&#8217;, &#8216;password&#8217;); DEFINE (&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;); DEFINE (&#8216;DB_NAME&#8217;, &#8216;database name&#8217;); $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die (&#8216;Could not connect to MySQL: &#8216; . mysql_error()); @mysql_select_db (DB_NAME) OR die(&#8216;Could not select the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=11&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is just an example of a config file which connects to a database for those who need it:</p>
<blockquote><p>
      DEFINE (&#8216;DB_USER&#8217;, &#8216;username&#8217;);<br />
      DEFINE (&#8216;DB_PASSWORD&#8217;, &#8216;password&#8217;);<br />
      DEFINE (&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);<br />
      DEFINE (&#8216;DB_NAME&#8217;, &#8216;database name&#8217;);<br />
      $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die (&#8216;Could not connect to MySQL: &#8216; . mysql_error());<br />
      @mysql_select_db (DB_NAME) OR die(&#8216;Could not select the database: &#8216; . mysql_error() );
</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rawcliffe.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rawcliffe.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rawcliffe.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rawcliffe.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rawcliffe.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rawcliffe.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rawcliffe.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rawcliffe.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rawcliffe.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rawcliffe.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rawcliffe.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rawcliffe.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rawcliffe.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rawcliffe.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rawcliffe.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rawcliffe.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=11&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rawcliffe.wordpress.com/2007/11/19/config-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e037766a838634d1118bfbf3934651ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Explode</title>
		<link>http://rawcliffe.wordpress.com/2007/11/19/explode/</link>
		<comments>http://rawcliffe.wordpress.com/2007/11/19/explode/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 21:53:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[explode]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://rawcliffe.wordpress.com/2007/11/19/explode/</guid>
		<description><![CDATA[The explode function in php is very simple to use. The syntax is something like this: explode( string seperator, string str ); And what the explode() function will do is get the string str as an array and then it will return each &#8220;word&#8221; separated by the first parameter as it&#8217;s own array element. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=10&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The explode function in php is very simple to use. The syntax is something like this:</p>
<blockquote><p>explode( string seperator, string str );</p></blockquote>
<p>And what the <strong>explode()</strong> function will do is get the <strong>string str</strong> as an array and then it will return each &#8220;word&#8221; separated by the first parameter as it&#8217;s own array element.<br />
<span id="more-10"></span><br />
The example below shows how this works:</p>
<blockquote><p>$str = &#8220;hello this is a string&#8221;;<br />
$words = explode(&#8221; &#8220;, $str);<br />
print_r($words);</p></blockquote>
<p>The explode in this example uses a space as a string separator. The variable <strong>$words</strong> is assigned to the explode and the <strong>print_r</strong> echoes out the array $words. The example above will return:</p>
<blockquote><p>Array ( [0] =&gt; hello [1] =&gt; this [2] =&gt; is [3] =&gt; a [4] =&gt; string )</p></blockquote>
<p>You can also use <strong>explode()</strong> to select specific words, for example, highlight words that have been used in a search query. To this, you basically do the same thing but you use a <strong>foreach</strong> loop to return each word separately and check it against an if statement.</p>
<blockquote><p>$sentence = &#8220;Hello-this-is-a-sentence&#8221;;<br />
$words = explode(&#8220;-&#8221;, $sentence);</p>
<p>foreach($words as $word){<br />
	if($word == $_GET['search_term']){<br />
		echo &#8220;<span>$word</span>&#8220;;<br />
	}<br />
	else<br />
	{<br />
		echo &#8220;$word &#8220;;<br />
	}<br />
}</p></blockquote>
<p>That will pretty much check any word that comes from the url which equals &#8220;search_term&#8221; and highlight it in red if there is a match.</p>
<p>For example, if you have <strong>file.php?search_term=Hello-this-is-foo</strong>, the separator is the &#8220;-&#8221; which is set earlier on in the explode and then it will check the string: &#8220;Hello-this-is-foo&#8221; against the sentence &#8220;Hello-this-is-a-sentence&#8221; and any words that match will be highlighted.</p>
<p>I hope this has helped your understanding of the <strong>explode()</strong>.</p>
<p>If you have any questions, just comment,</p>
<p>Thanks for reading,</p>
<p>Matt</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rawcliffe.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rawcliffe.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rawcliffe.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rawcliffe.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rawcliffe.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rawcliffe.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rawcliffe.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rawcliffe.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rawcliffe.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rawcliffe.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rawcliffe.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rawcliffe.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rawcliffe.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rawcliffe.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rawcliffe.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rawcliffe.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=10&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rawcliffe.wordpress.com/2007/11/19/explode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e037766a838634d1118bfbf3934651ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello</title>
		<link>http://rawcliffe.wordpress.com/2007/11/14/hello/</link>
		<comments>http://rawcliffe.wordpress.com/2007/11/14/hello/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 18:54:57 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[welcome]]></category>

		<guid isPermaLink="false">http://rawcliffe.wordpress.com/2007/11/14/hello/</guid>
		<description><![CDATA[Just added my blog&#8230; I&#8217;ll start writing tutorials soon&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=4&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just added my blog&#8230; I&#8217;ll start writing tutorials soon&#8230;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rawcliffe.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rawcliffe.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rawcliffe.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rawcliffe.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rawcliffe.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rawcliffe.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rawcliffe.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rawcliffe.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rawcliffe.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rawcliffe.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rawcliffe.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rawcliffe.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rawcliffe.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rawcliffe.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rawcliffe.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rawcliffe.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rawcliffe.wordpress.com&amp;blog=2123914&amp;post=4&amp;subd=rawcliffe&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rawcliffe.wordpress.com/2007/11/14/hello/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e037766a838634d1118bfbf3934651ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Matt</media:title>
		</media:content>
	</item>
	</channel>
</rss>
