<?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>MB Web Design &#187; PHP</title>
	<atom:link href="http://www.mbwebdesign.co.uk/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mbwebdesign.co.uk</link>
	<description></description>
	<lastBuildDate>Sun, 08 Aug 2010 16:46:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Generating a Random Integer with PHP</title>
		<link>http://www.mbwebdesign.co.uk/generating-a-random-integer-with-php/</link>
		<comments>http://www.mbwebdesign.co.uk/generating-a-random-integer-with-php/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 14:49:25 +0000</pubDate>
		<dc:creator>Mathew Browne</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mbwebdesign.co.uk/?p=505</guid>
		<description><![CDATA[This is a function I&#8217;ve found very useful in a number of Wordpress themes I&#8217;ve been developing, whereby I want to randomly select and display one of a set number of jpgs (called 1.jpg, 2.jpg, 3.jpg et cetera)
The magic function is rand() which returns a random integer. There are two uses
int rand  (void)
int rand [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-505"></span>This is a function I&#8217;ve found very useful in a number of Wordpress themes I&#8217;ve been developing, whereby I want to randomly select and display one of a set number of jpgs (called 1.jpg, 2.jpg, 3.jpg et cetera)</p>
<p>The magic function is rand() which returns a random integer. There are two uses</p>
<pre>int rand  (void)
int rand (int $min , int $max)</pre>
<p>If you don&#8217;t supply any variables, rand() returns a random integer between 0 and RAND_MAX. RAND_MAX is usually 32768 on Windows systems, if you need a higher value, then you need to specify a $min and $max variable to generate a larger range.</p>
<p>If you supply a range of integers to rand(), then the range of possible values between $min and $max inclusive.</p>
<h3>Examples</h3>
<pre>&lt;?php echo rand(); ?&gt;</pre>
<p>Could return integers such as 7734, 1981, 2, 0, 30929 etc.</p>
<pre>&lt;?php echo rand(1,5) ?&gt;</pre>
<p>Will return one of the following: 1,2,3,4,5.</p>
<pre>&lt;?php echo rand(15000,50000) ?&gt;</pre>
<p>Will return any integer between (and including) 15000 and 50000.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mbwebdesign.co.uk/generating-a-random-integer-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
