<?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/"
	>

<channel>
	<title>PHPMule.com Blog</title>
	<atom:link href="http://www.phpmule.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmule.com/blog</link>
	<description>PHP for beginner's</description>
	<pubDate>Wed, 10 Jun 2009 21:42:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP - Rounding Off Numbers</title>
		<link>http://www.phpmule.com/blog/2009/06/10/php-rounding-off-numbers/</link>
		<comments>http://www.phpmule.com/blog/2009/06/10/php-rounding-off-numbers/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 21:42:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Float]]></category>

		<category><![CDATA[Number]]></category>

		<category><![CDATA[Rounding Off Numbers]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=76</guid>
		<description><![CDATA[Back to learning PHP!]]></description>
			<content:encoded><![CDATA[<p>I am back to learning php as I have been away for a while working on projects but hey I&#8217;m back!</p>
<p>Rounding numbers in PHP is very easy as I needed to include this function in one of my scripts&#8230;</p>
<p>Let&#8217;s say we had the following number: 5.76. Like most people we  don&#8217;t need to see the extra digits as it makes the web page look more messy. You may want to round numbers because of many reasons and it&#8217;s a good function to use when rounding money etc.</p>
<p>If we wanted to round 5.76 to the nearest  integer (6) we would need to do the following.</p>
<p>Let&#8217;s begin with variable $number containing 5.76</p>
<p>$number = 5.76;</p>
<p>Then we use the following expression:</p>
<p>$number = round ($number);</p>
<p>Now what will happen is that variable $number will now contain the rounded off number so when you echo or print it back to the browser you will see the number &#8220;6&#8243; displayed. That&#8217;s all to it!</p>
<p>You can also round the number to a specified decimal place, for example:</p>
<p>$number = round ($number, 2);</p>
<p>will output 5.8 to the browser!</p>
<p>(Post created on Wednesday, June 10th 09 at 22:40)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/06/10/php-rounding-off-numbers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Single vs Double Quotation Marks</title>
		<link>http://www.phpmule.com/blog/2009/05/01/php-single-vs-double-quotation-marks/</link>
		<comments>http://www.phpmule.com/blog/2009/05/01/php-single-vs-double-quotation-marks/#comments</comments>
		<pubDate>Fri, 01 May 2009 22:36:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Double Quotation Marks]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Single Quotation Marks]]></category>

		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=74</guid>
		<description><![CDATA[Listening to music!]]></description>
			<content:encoded><![CDATA[<p>In PHP you can use either single quotation marks or double quotation marks. Anything contained between single quotation marks will be treated literally and anything between double quotation marks will be interpreted. For example:</p>
<p>echo &#8216;Here is a variable and the variable is $var&#8217;;</p>
<p>would literally output: Here is a variable and the variable is $var</p>
<p>If you put this line between double quotation marks it would output the following:</p>
<p>Here is a variable and the variable is 15.</p>
<p>There is one case where you may need to alternate the use the single and double quotes. Look at the following example:</p>
<p>echo &#8216;I will be going on holiday shortly and I&#8217;m taking my laptop with me&#8217;;</p>
<p>You will notice that you have used the &#8216; symbol three times so therefore it will give a parse error. In this case you will have to use the double quotes. By the way this can happen vice versa as well so be careful when using single and double quotes in sentences.</p>
<p>(Post created on Friday, May 1st 09 at 23:35)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/05/01/php-single-vs-double-quotation-marks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Loading Files Into Your PHP Script By Using require() and include()</title>
		<link>http://www.phpmule.com/blog/2009/04/16/php-loading-files-into-your-php-script-by-using-require-and-include/</link>
		<comments>http://www.phpmule.com/blog/2009/04/16/php-loading-files-into-your-php-script-by-using-require-and-include/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 12:50:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[include()]]></category>

		<category><![CDATA[Loading Files]]></category>

		<category><![CDATA[require()]]></category>

		<category><![CDATA[Reusing Code]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=71</guid>
		<description><![CDATA[Quite an easy function to learn!]]></description>
			<content:encoded><![CDATA[<p>If you wanted to reuse code from another file you could easily do this by using the require() or include() functions. These functions work exactly the same as server side includes files as in HTML.</p>
<p>These two functions work the same except when they fail to execute. If they fail the require() gives a fatal error and therefore stopping the execution of the remainder of the script and the include() function only gives a warning but doesn&#8217;t stop processing the script.</p>
<p>It&#8217;s recommended that you use the require() function rather than the include() function as your scripts shouldn&#8217;t be executing if for example your files are named wrong or placed in another directory.</p>
<p>Lets create a file called tester.php with the following file contents:</p>
<p>&lt;?php</p>
<p>echo &#8216;I am a php script &lt;br /&gt;&#8217;;</p>
<p>?&gt;</p>
<p>Now in the index.php file we could have the following code:</p>
<p>&lt;?php</p>
<p>echo &#8216;Another file will be included &lt;br /&gt;&#8217;;</p>
<p>require ( &#8216;tester.php&#8217; );</p>
<p>echo &#8216;Above is the contents of the tester.php file&#8217;;</p>
<p>?&gt;</p>
<p>As you can see it&#8217;s quite simple to use other files in your php scripts and can save you a lot of time as you don&#8217;t need to reuse the code.</p>
<p>(Post created on Thursday, April 16th 09 at 13:50)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/16/php-loading-files-into-your-php-script-by-using-require-and-include/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Replacing Strings With Other Strings</title>
		<link>http://www.phpmule.com/blog/2009/04/15/php-replacing-strings-with-other-strings/</link>
		<comments>http://www.phpmule.com/blog/2009/04/15/php-replacing-strings-with-other-strings/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 20:55:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Replacing Strings]]></category>

		<category><![CDATA[str_replace()]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=69</guid>
		<description><![CDATA[Also a little confusing bit still got there!]]></description>
			<content:encoded><![CDATA[<p>This is a very useful function to include in web forms or anywhere where user&#8217;s can leave input. What this function does is replace strings with strings for example, replacing swear words with something else such as &#8216;****&#8217;. This can be easily done in PHP by using the following format:</p>
<p>str_replace(findwhat, replacewith, whichstring)</p>
<p>If we used this format we could produce the following:</p>
<p>$modifiedcomments = str_replace(&#8221;water&#8221;, &#8216;fire&#8217;, $comments);<br />
echo $modifiedcomments;</p>
<p>This will replace water with fire in the variable $comments. So when the script get&#8217;s processed a new variable called $modifiedcomments will be created and if it finds the word or string &#8216;water&#8217; it will be replaced with &#8216;fire&#8217;.</p>
<p>(Post created on Wednesday, April 15th 09 at 21:55)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/15/php-replacing-strings-with-other-strings/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Finding Strings Within Strings</title>
		<link>http://www.phpmule.com/blog/2009/04/15/php-finding-strings-within-strings/</link>
		<comments>http://www.phpmule.com/blog/2009/04/15/php-finding-strings-within-strings/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 14:43:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Finding Strings]]></category>

		<category><![CDATA[strchr()]]></category>

		<category><![CDATA[stristr()]]></category>

		<category><![CDATA[strrchr()]]></category>

		<category><![CDATA[strstr()]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=66</guid>
		<description><![CDATA[Bit puzzling at first but now understand these functions!]]></description>
			<content:encoded><![CDATA[<p>There are four functions you can use to find strings:</p>
<p>- strstr()</p>
<p>- strchr()</p>
<p>- strrchr()</p>
<p>- stristr()</p>
<p>The first function: strstr() can be used to find a string inside another or longer string for example:</p>
<p>if (strstr($string, &#8216;computer&#8217;))</p>
<p>echo &#8220;The word computer is found&#8221;;</p>
<p>This function is basically testing out whether or not the string &#8216;computer&#8217; is in the variable $string. If the string is in variable $string it would output &#8220;The word computer is found&#8221; to the browser.</p>
<p>The second function we could use is strchr(). This function is the nearly similiar to the first function but this one finds a specific character such as &#8216;@&#8217; or any other character.</p>
<p>The third function: strrchr() finds the last occurence of a character or string and then returns all the characters from that point onward. The last function is the stristr() function. This is the same as the strstr() function but it&#8217;s not case sensitive so you could find the string whether or not it&#8217;s in capitals or not (or both caps and not caps)</p>
<p>(Post created on Wednesday, April 15th 09 at 15:45)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/15/php-finding-strings-within-strings/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Using strlen() To Test String Length</title>
		<link>http://www.phpmule.com/blog/2009/04/14/php-using-strlen-to-test-string-length/</link>
		<comments>http://www.phpmule.com/blog/2009/04/14/php-using-strlen-to-test-string-length/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 12:56:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[IF]]></category>

		<category><![CDATA[String Length]]></category>

		<category><![CDATA[strlen()]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=64</guid>
		<description><![CDATA[This is a very useful function if you wanted to validate your visitor&#8217;s input on a web form. You could use this function to test out the length of their email address. The mininum length of an email address is six characters.
To test out the string we would use an If function along with the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very useful function if you wanted to validate your visitor&#8217;s input on a web form. You could use this function to test out the length of their email address. The mininum length of an email address is six characters.</p>
<p>To test out the string we would use an If function along with the strlen() to find out if the string is more than six characters:</p>
<p>if (strlen($emailaddress) &lt; 6) {</p>
<p>echo &#8216;Your email address is not valid&#8217;;</p>
<p>exit;</p>
<p>}</p>
<p>We could use this function on other input fields if we wanted to and it&#8217;s one useful measure against your visitors from sending spam. You can also limit the size using this function as well:</p>
<p>if(strlen($forename) &gt; 30 {</p>
<p>echo &#8216;Your forename is too long&#8217;;</p>
<p>exit;</p>
<p>}</p>
<p>It should be in your best interest to implement these features in your forms because of security. There are other functions as well which validate user data which I will go through in another blog post!</p>
<p>(Post created on Tuesday, April 14th 09 at 13:45)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/14/php-using-strlen-to-test-string-length/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Using The explode() Function</title>
		<link>http://www.phpmule.com/blog/2009/04/13/php-using-the-explode-function/</link>
		<comments>http://www.phpmule.com/blog/2009/04/13/php-using-the-explode-function/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 21:11:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[explode()]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=58</guid>
		<description><![CDATA[Listening to Rihanna]]></description>
			<content:encoded><![CDATA[<p>As it says the explode function is like sticking a dynamite on parts of the string to give you different sections of the string. Lets say we have a list of colors in a variable:</p>
<p>$colors = &#8220;blue;yellow;green;orange;white&#8221;;</p>
<p>What would happen if we explode them? They would be separated. It&#8217;s best if we make an array for them:</p>
<p>$colorarray = explode (&#8221;;&#8221;, $colors);</p>
<p>As we want to explode the &#8216;;&#8217; we have to include this in the first part of the function as you can see in the above example. We then include the variable we want to explode after it. After the &#8216;explosion&#8217; the &#8216;;&#8217; is basically destroyed leaving the colors separated from each other and subsequently stored in the $colorarray.</p>
<p>(Post created on Monday, April 12th 09 at 22:10)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/13/php-using-the-explode-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Changing The String Case</title>
		<link>http://www.phpmule.com/blog/2009/04/13/php-changing-the-string-case/</link>
		<comments>http://www.phpmule.com/blog/2009/04/13/php-changing-the-string-case/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 18:31:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[String Case]]></category>

		<category><![CDATA[strtolower]]></category>

		<category><![CDATA[strtoupper]]></category>

		<category><![CDATA[ucfirst]]></category>

		<category><![CDATA[ucwords]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=55</guid>
		<description><![CDATA[Watching Wanted on DVD.]]></description>
			<content:encoded><![CDATA[<p>If you wanted to change the case of a string for example the word &#8216;television&#8217; into &#8216;TELEVISION&#8217; you can easily do so in PHP. You can do it vice versa as well.</p>
<p>Here are the following functions you can use to change the case of a string:</p>
<p>Let&#8217;s use the following functions with the variable &#8216;$television&#8217; By the way the variable $television contains the value &#8220;what brand of tv do you own?&#8221;</p>
<p>strtoupper($television) = WHAT BRAND OF TV DO YOU OWN?</p>
<p>strrtolower($televison) = what brand of tv do you own?</p>
<p>ucfirst($television) = What brand of tv do you own?</p>
<p>ucwords($televison) = What Brand Of Tv Do You Own?</p>
<p>The first function converts the alphabetic characters to uppercase, the second to uppercase. The third function converts the first letter of the first word in uppercase and the fourth function converts the first letter of each word in uppercase.</p>
<p>These functions could be used in web forums and you would prefer your comments to start in uppercase. To be honest it really depends on how well you want to present your website I suppose.</p>
<p>(Post created on Monday, April 12th 09 at 19:30)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/13/php-changing-the-string-case/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - The nl2br() Function</title>
		<link>http://www.phpmule.com/blog/2009/04/13/php-the-nl2br-function/</link>
		<comments>http://www.phpmule.com/blog/2009/04/13/php-the-nl2br-function/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 16:16:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Break]]></category>

		<category><![CDATA[New Line]]></category>

		<category><![CDATA[nl2br()]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=52</guid>
		<description><![CDATA[Still watching RE: Degeneration!]]></description>
			<content:encoded><![CDATA[<p>This function stands for: New Line 2 Break</p>
<p>If the visitor wanted to see what he or she has entered on a  form it would appear on one line if it was echoed. If we use the nl2br() function it would echo the feedback with the new lines replaced with breaks:</p>
<p>If we used it without this function is would look like this:</p>
<p>Forename: Nathan Comments: It looks better with the nl2br() dont you think?</p>
<p>If we used with nl2br() it would look like this:</p>
<p>Forname: Nathan</p>
<p>Comments: It looks better with the nl2br() dont you think?</p>
<p>echo nl2br($feedback);</p>
<p>(Post created on Monday, April 12th 09 at 17:15)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/13/php-the-nl2br-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Trimming Strings</title>
		<link>http://www.phpmule.com/blog/2009/04/13/php-formatting-strings/</link>
		<comments>http://www.phpmule.com/blog/2009/04/13/php-formatting-strings/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 15:31:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[ltrim()]]></category>

		<category><![CDATA[rtrim()]]></category>

		<category><![CDATA[Strings]]></category>

		<category><![CDATA[trim()]]></category>

		<category><![CDATA[Trimming Strings]]></category>

		<guid isPermaLink="false">http://www.phpmule.com/blog/?p=49</guid>
		<description><![CDATA[Watching RE: Regeneration whilst watching this]]></description>
			<content:encoded><![CDATA[<p>The trimming string functions:</p>
<p>In a string you can have excess whitespace you don&#8217;t need but is very useful if you want to store this string in a file or database.</p>
<p>The trim() function will remove any whitespace from the beginning or end of string for example if you had the string &#8220;   celebrity   &#8221; the resulting string will be &#8220;celebrity&#8221; as all the whitespace is removed from the start and end.</p>
<p>There are two other trimming functions and these are:</p>
<p>ltrim() and rtrim()</p>
<p>These functions do the same thing as the &#8216;trim()&#8217; function but instead the first one removes whitespace from the left hand side and the other one removes whitespace from the right hand side.</p>
<p>The main purpose of trimming is to have cleaner input from your visitors, for  example if they were to accidently include a space before they input their name on a form.</p>
<p>(Post created on Monday, April 13th 09 at 16:30)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmule.com/blog/2009/04/13/php-formatting-strings/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
