<?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>PHP Magic Book - Free PHP Scripts, Tutorials and Downloads &#187; Explode</title>
	<atom:link href="http://www.phpmagicbook.com/tag/explode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmagicbook.com</link>
	<description>PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips</description>
	<lastBuildDate>Tue, 15 Jun 2010 13:22:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP &#8211; Explode</title>
		<link>http://www.phpmagicbook.com/php-explode/</link>
		<comments>http://www.phpmagicbook.com/php-explode/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 00:06:22 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Explode]]></category>
		<category><![CDATA[PHP Functions]]></category>
		<category><![CDATA[Functions]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=180</guid>
		<description><![CDATA[The PHP function explode lets you take a string and blow it up into smaller pieces. For example, if you had a sentence you could ask explode to use the sentence&#8217;s spaces &#8221; &#8221; as dynamite and it would blow up the sentence into separate words, which would be stored in an array. The sentence [...]<p><a href="http://www.phpmagicbook.com/php-explode/">PHP &#8211; Explode</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The PHP function explode lets you take a string and blow it up into smaller pieces. For example, if you had a sentence you could ask explode to use the sentence&#8217;s spaces &#8221; &#8221; as dynamite and it would blow up the sentence into separate words, which would be stored in an array. The sentence &#8220;Hello, world, PHP is amazing language.&#8221; would look like this after explode got done with it:</p>
<p>1. Hello,<br />
2. world,<br />
3. PHP<br />
4. is<br />
5. amazing<br />
6. language</p>
<p><span id="more-247"></span></p>
<h4>PHP Explode Example</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$Number</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;888-111-2222&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$Pieces</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Number</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// note &quot;-&quot;</span>
<span style="color: #666666; font-style: italic;">// We are asking the script to break pieces from left and right side of -</span>
<span style="color: #666666; font-style: italic;">// This thing determines that what is separating the parts of a whole thing</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Whole Number = <span style="color: #006699; font-weight: bold;">$Number</span> &lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Piece 1 = <span style="color: #006699; font-weight: bold;">$num[0]</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Piece 2 = <span style="color: #006699; font-weight: bold;">$num[1]</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Piece 3 = <span style="color: #006699; font-weight: bold;">$num[2]</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Result</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Whole Number = 888-111-2222
Piece 1 = 888
Piece 2 = 111
Piece 3 = 2222</pre></div></div>

<h4>Random &#8211; Another Example</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$animals</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cat mouse dog horse snake&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$selected</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$animals</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// In this case our breaking point is a space and not -</span>
<span style="color: #666666; font-style: italic;">// in 23423*343*7897678 the breaking point can be *</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;All = <span style="color: #006699; font-weight: bold;">$animals</span> &lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Second = <span style="color: #006699; font-weight: bold;">$selected[1]</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Fourth = <span style="color: #006699; font-weight: bold;">$selected[3]</span>&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;First = <span style="color: #006699; font-weight: bold;">$selected[0]</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Result</h4>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">All = cat mouse dog horse snake
Second = mouse
Fourth = horse
First = cat</pre></div></div>

<p><a href="http://www.phpmagicbook.com/php-explode/">PHP &#8211; Explode</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/show-a-part-of-string-substr/" title="Show A Part Of String &#8211; substr in PHP">Show A Part Of String &#8211; substr in PHP</a></li><li><a href="http://www.phpmagicbook.com/function-existence-check/" title="Function Existence Check Using PHP">Function Existence Check Using PHP</a></li><li><a href="http://www.phpmagicbook.com/isset-function/" title="isset Function in PHP &#8211; Check for any Variable if it is Set or Not in PHP">isset Function in PHP &#8211; Check for any Variable if it is Set or Not in PHP</a></li><li><a href="http://www.phpmagicbook.com/php-implode/" title="PHP &#8211; Implode">PHP &#8211; Implode</a></li><li><a href="http://www.phpmagicbook.com/php-functions/" title="PHP Functions">PHP Functions</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/php-explode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
