<?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>Peep in my mind &#187; numbers</title>
	<atom:link href="http://peepinmymind.com/tag/numbers/feed/" rel="self" type="application/rss+xml" />
	<link>http://peepinmymind.com</link>
	<description>...</description>
	<lastBuildDate>Sun, 30 May 2010 16:13:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Numbers</title>
		<link>http://peepinmymind.com/web/2009/06/numbers/</link>
		<comments>http://peepinmymind.com/web/2009/06/numbers/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 05:07:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[numbers]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Doing math in php $variable = value * value $variable = value + value $variable = value &#8211; value $variable = value / value Formatting Numbers Rounding numbers &#8211; rounds values to specified decimal places. It can be number or variables. There is an option that allow users to round too the number of decimal [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-139" title="php101" src="http://peepinmymind.com/wp-content/uploads/2009/04/php101.gif" alt="php101" width="550" height="270" /><br />
Doing math in php</p>
<p>$variable = value * value<br />
$variable = value + value<br />
$variable = value &#8211; value<br />
$variable = value / value</p>
<p><strong>Formatting Numbers</strong></p>
<p>Rounding numbers &#8211; rounds values to specified decimal places. It  can be number or variables.  There is an option that allow users to round too the number of decimal places.</p>
<p>Example:<br />
round (6.20); = 6<br />
round (6.369, 2); = 6.37<br />
$number = 694.2783;<br />
round ($number); = 694</p>
<p>Number format &#8211; works like round but adds commas in the to numbers.<br />
number_format (6.2243, 2); = 6.22<br />
number_format (69, 2); = 69.00<br />
number_format (123456789); = 123,456,789</p>
<p><strong>Precedence </strong>- the order in which calculations are made.</p>
<p>8 &#8211; 4 / 2 = 6 and not 2 because division comes first.</p>
<p>To avoid this use ()<br />
(8 &#8211; 4) /2 ) = 2<br />
8 &#8211; (4 / 2 ) = 6</p>
<p>Incrementing and decrementing a number add or subtracts 1 value<br />
$var++; or $var&#8211;; this will give the value +1 or -1 effect.</p>
<p><strong>Creating random numbers</strong></p>
<p>rand()</p>
<p>$n = rand();- this generate random number<br />
$n = rand(0,100); &#8211; this generate random number 0 to 100</p>
<p>Other types are getrandmax() &#8211; get height random number<br />
mt_rand() &#8211; it suppose to work better then rand and great for cryptography.</p>
<p>These notes are from  <a href="http://www.amazon.com/gp/product/0321442490?ie=UTF8&amp;tag=booofdea-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321442490">PHP for the World Wide Web, Third Edition (Visual QuickStart Guide)</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=booofdea-20&amp;l=as2&amp;o=1&amp;a=0321442490" border="0" alt="" width="1" height="1" /> written by Larry Ullman. In order to make sense of my notes you should pruchase the PHP book its very well written and easy to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://peepinmymind.com/web/2009/06/numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

