<?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>BRADINO &#187; Search Results  &#187;  explode</title>
	<atom:link href="http://www.bradino.com/?s=explode&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.bradino.com</link>
	<description>LAMP Development Tutorials, Code, Tips &#38; Tricks</description>
	<lastBuildDate>Sat, 10 Oct 2009 20:49:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Analytics API</title>
		<link>http://www.bradino.com/php/google-analytics-api/</link>
		<comments>http://www.bradino.com/php/google-analytics-api/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 20:43:01 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4794</guid>
		<description><![CDATA[Unfortunately Google Analytics does not have an API yet... However I will show you a quick and dirty way to get the data you need. The idea is basically to setup an automated report from within Google Analytics, which will email a CSV file attachment, that you can download and parse with a script. For [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately Google Analytics does not have an API yet... However I will show you a quick and dirty way to get the data you need. The idea is basically to setup an automated report from within Google Analytics, which will email a CSV file attachment, that you can download and parse with a script. For this example I will use the Zend Mail class because I love Zend Mail and it is free.</p>
<p>So the first step is to schedule the report. For this simple example we will use the default Visitors Report. So login to your Google Analytics account, click Visitors on the main left nav, then click the Email icon up at the top of the report, see screenshot below:</p>
<div id="attachment_4795" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bradino.com/wp-content/uploads/2008/12/ga-screenshot.jpg"><img src="http://www.bradino.com/wp-content/uploads/2008/12/ga-screenshot-300x132.jpg" alt="GA Screenshot" title="ga-screenshot" width="300" height="132" class="size-medium wp-image-4795" /></a><p class="wp-caption-text">Google Analytics  Screenshot</p></div>
<p>Now let's get to the code. First step is to connect to your POP mail server and get the new messages. Don't forget to download the latest version of Zend at http://framework.zend.com.</p>
<div class="syntax_hilite">
<div id="php-6">
<div class="php"><span style="color:#616100;">include</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Zend/Mail/Storage/Pop3.php'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$params</span> = <a href="http://www.bradino.com/php-functions/array/"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'host'</span> =&gt; <span style="color:#FF0000;">"mail.domain.com"</span>, <span style="color:#FF0000;">'user'</span> =&gt; <span style="color:#FF0000;">"info@domain.com"</span>, <span style="color:#FF0000;">'password'</span> =&gt; <span style="color:#FF0000;">"secret"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$mail</span> = <span style="color:#000000; font-weight:bold;">new</span> Zend_Mail_Storage_Pop3<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$params</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$num</span> = <span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">countMessages</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>In a production environment, you would want some logic to verify that the number of messages is greater than 0, loop through the messages, etc but for this tutorial I have omitted these items for brevity. So next we need to download the first message and get its parts.</p>
<div class="syntax_hilite">
<div id="php-7">
<div class="php"><span style="color:#0000FF;">$message</span> = <span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">getMessage</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color:#0000FF;">$parts</span> = <span style="color:#0000FF;">$message</span>-&gt;<span style="color:#006600;">countParts</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>Next we spin through the parts, looking for the attachment.</p>
<div class="syntax_hilite">
<div id="php-8">
<div class="php"><span style="color:#616100;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$b</span>=<span style="color:#CC66CC;">1</span>; <span style="color:#0000FF;">$b</span>&lt;=<span style="color:#0000FF;">$parts</span>; <span style="color:#0000FF;">$b</span>++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$part</span> = <span style="color:#0000FF;">$message</span>-&gt;<span style="color:#006600;">getPart</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$b</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> = <span style="color:#0000FF;">$part</span>-&gt;<span style="color:#006600;">getHeaders</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.bradino.com/php-functions/empty/"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$headers</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Content-Disposition'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> || !<a href="http://www.bradino.com/php-functions/empty/"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$headers</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'content-disposition'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</div>
</div>
<p></p>
<p>Then we parse the CSV file to an array for simple looping:</p>
<div class="syntax_hilite">
<div id="php-9">
<div class="php"><span style="color:#0000FF;">$csv</span> = <a href="http://www.bradino.com/php-functions/base64_decode/"><span style="color:#000066;">base64_decode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$part</span>-&gt;<span style="color:#006600;">getContent</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color:#0000FF;">$lines</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>,<span style="color:#0000FF;">$csv</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$data</span> = <a href="http://www.bradino.com/php-functions/array/"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$lines</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$line</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">','</span>,<span style="color:#0000FF;">$line</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</div>
</div>
<p></p>
<p>The previous code checks the email account, downloads the CSV attachment and parses it to an array. That is all going to stay the same but the matching below will change depending on your needs. For this simplistic example, I am going to get the number of visits from yesterday.</p>
<div class="syntax_hilite">
<div id="php-10">
<div class="php"><span style="color:#0000FF;">$yesterday</span> = <a href="http://www.bradino.com/php-functions/date/"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'F j'</span>,<a href="http://www.bradino.com/php-functions/mktime/"><span style="color:#000066;">mktime</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;">0</span>, <span style="color:#CC66CC;">0</span>, <span style="color:#CC66CC;">0</span>, <a href="http://www.bradino.com/php-functions/date/"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'m'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <a href="http://www.bradino.com/php-functions/date/"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'d'</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;">1</span>, <a href="http://www.bradino.com/php-functions/date/"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Y'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$row</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$row</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#FF0000;">'&quot;'</span>.<span style="color:#0000FF;">$yesterday</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$visits</span> = <span style="color:#0000FF;">$row</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"VISITS: {$visits}"</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</div>
</div>
<p></p>
<p>So that's basically it. Of course in production you would probably want to write the Google Analytics data to a database or whatever, but you get the point! Hopefully Google Analytics will get an API soon, but until then, this works like a champ!</p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/google analytics api/" rel="tag">google analytics api</a> <a href="http://www.bradino.com/search/google analytics/" rel="tag">google analytics</a> <a href="http://www.bradino.com/search/google api/" rel="tag">google api</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;t=Google%20Analytics%20API" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;h=Google%20Analytics%20API" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=Google%20Analytics%20API&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;=Google%20Analytics%20API" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;t=Google%20Analytics%20API" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=Unfortunately%20Google%20Analytics%20does%20not%20have%20an%20API%20yet...%20However%20I%20will%20show%20you%20a%20quick%20and%20dirty%20way%20to%20get%20the%20data%20you%20need.%20The%20idea%20is%20basically%20to%20setup%20an%20automated%20report%20from%20within%20Google%20Analytics%2C%20which%20will%20email%20a%20CSV%20file%20attachment" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;t=Google%20Analytics%20API" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;title=Google%20Analytics%20API" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F&amp;submitHeadline=Google%20Analytics%20API&amp;submitSummary=Unfortunately%20Google%20Analytics%20does%20not%20have%20an%20API%20yet...%20However%20I%20will%20show%20you%20a%20quick%20and%20dirty%20way%20to%20get%20the%20data%20you%20need.%20The%20idea%20is%20basically%20to%20setup%20an%20automated%20report%20from%20within%20Google%20Analytics%2C%20which%20will%20email%20a%20CSV%20file%20attachment&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=Google%20Analytics%20API&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgoogle-analytics-api%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/google-analytics-api/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Geocoding: Location to Latitude/Longitude</title>
		<link>http://www.bradino.com/php/geocoding-location-latitude-longitude/</link>
		<comments>http://www.bradino.com/php/geocoding-location-latitude-longitude/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 17:09:20 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4735</guid>
		<description><![CDATA[Both Google and Yahoo offer free geocoding services. Geocoding is the process of getting the latitude/longitude coordinates for a particular address or location. With the latitude/longitude coordinates you can fun things like plot markers on a map, calculate distances between points, etc. I have created two simple standalone functions to geocode an address, one for [...]]]></description>
			<content:encoded><![CDATA[<p>Both Google and Yahoo offer free geocoding services. Geocoding is the process of getting the latitude/longitude coordinates for a particular address or location. With the latitude/longitude coordinates you can fun things like plot markers on a map, calculate distances between points, etc. I have created two simple standalone functions to geocode an address, one for Google and one for Yahoo. Both require an API key. </p>
<p><a href="http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct" target="_blank">Google Documentation</a> <a href="http://code.google.com/apis/maps/signup.html" target="_blank">Google API Key</a> <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html" target="_blank">Yahoo Documentation</a> <a href="http://developer.yahoo.com/wsregapp/" target="_blank">Yahoo API Key</a> </p>
<div class="syntax_hilite">
<div id="php-14">
<div class="php"><span style="color:#FF9933; font-style:italic;">// API KEYS</span></p>
<p><span style="color:#0000FF;">$googleKey</span> = <span style="color:#FF0000;">"INSERT-API-KEY"</span>;</p>
<p><span style="color:#0000FF;">$yahooKey</span> = <span style="color:#FF0000;">"INSERT-API-KEY"</span>;</p>
<p>
<span style="color:#FF9933; font-style:italic;">// ARRAY OF LOCATION PARAMETERS</span></p>
<p><span style="color:#0000FF;">$params</span> = <a href="http://www.bradino.com/php-functions/array/"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$params</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'address'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"2470 E Street"</span>;</p>
<p><span style="color:#0000FF;">$params</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'city'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"San Diego"</span>;</p>
<p><span style="color:#0000FF;">$params</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'state'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"CA"</span>;</p>
<p><span style="color:#0000FF;">$params</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'zip'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"92102"</span>;</div>
</div>
</div>
<p></p>
<div class="syntax_hilite">
<div id="php-15">
<div class="php"><span style="color:#FF9933; font-style:italic;">// GEOCODING USING GOOGLE</span></p>
<p><span style="color:#0000FF;">$coords</span> = geocodeGoogle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$params</span>,<span style="color:#0000FF;">$googleKey</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Latitude: {$coords['latitude']}&lt;br&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</p>
<p><a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Longitude: {$coords['longitude']}&lt;br&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</p>
<p>
<span style="color:#FF9933; font-style:italic;">// GOOGLE GEOCODE FUNCTION</span></p>
<p><span style="color:#000000; font-weight:bold;">function</span> geocodeGoogle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$params</span>,<span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$location</span> = <a href="http://www.bradino.com/php-functions/strtolower/"><span style="color:#000066;">strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/str_replace/"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">' '</span>,<span style="color:#FF0000;">'+'</span>,<span style="color:#FF0000;">"{$params['address']}, {$params['city']}, {$params['state']}, {$params['zipcode']}"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$url</span> = <span style="color:#FF0000;">"http://maps.google.com/maps/geo?q={$location}&amp;output=csv&amp;key={$key}"</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$response</span> = <a href="http://www.bradino.com/php-functions/file_get_contents/"><span style="color:#000066;">file_get_contents</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$parts</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">','</span>,<span style="color:#0000FF;">$response</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#616100;">return</span> <a href="http://www.bradino.com/php-functions/array/"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'latitude'</span> =&gt; <span style="color:#0000FF;">$parts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#FF0000;">'longitude'</span> =&gt; <span style="color:#0000FF;">$parts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</div>
</div>
<p></p>
<div class="syntax_hilite">
<div id="php-16">
<div class="php"><span style="color:#FF9933; font-style:italic;">// GEOCODING USING YAHOO</span></p>
<p><span style="color:#0000FF;">$coords</span> = geocodeYahoo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$params</span>,<span style="color:#0000FF;">$yahooKey</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Latitude: {$coords['latitude']}&lt;br&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</p>
<p><a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Longitude: {$coords['longitude']}&lt;br&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</p>
<p>
<span style="color:#FF9933; font-style:italic;">// YAHOO GEOCODE FUNCTION</span></p>
<p><span style="color:#000000; font-weight:bold;">function</span> geocodeYahoo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$params</span>,<span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$location</span> = <a href="http://www.bradino.com/php-functions/strtolower/"><span style="color:#000066;">strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/str_replace/"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">' '</span>,<span style="color:#FF0000;">'+'</span>,<span style="color:#FF0000;">"{$params['address']}, {$params['city']}, {$params['state']}, {$params['zipcode']}"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$url</span> = <span style="color:#FF0000;">"http://local.yahooapis.com/MapsService/V1/geocode?appid={$key}&amp;location={$location}&amp;output=php"</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$response</span> = <a href="http://www.bradino.com/php-functions/file_get_contents/"><span style="color:#000066;">file_get_contents</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$data</span> = <a href="http://www.bradino.com/php-functions/unserialize/"><span style="color:#000066;">unserialize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$response</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#616100;">return</span> <a href="http://www.bradino.com/php-functions/array/"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'latitude'</span> =&gt; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'ResultSet'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Result'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Latitude'</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#FF0000;">'longitude'</span> =&gt; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'ResultSet'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Result'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Longitude'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</div>
</div>
<p></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/geocoding/" rel="tag">geocoding</a> <a href="http://www.bradino.com/search/geocode/" rel="tag">geocode</a> <a href="http://www.bradino.com/search/altitude/longitude/" rel="tag">altitude/longitude</a> <a href="http://www.bradino.com/search/latitude/" rel="tag">latitude</a> <a href="http://www.bradino.com/search/longitude/" rel="tag">longitude</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;t=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;h=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;t=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=Both%20Google%20and%20Yahoo%20offer%20free%20geocoding%20services.%20Geocoding%20is%20the%20process%20of%20getting%20the%20latitude%2Flongitude%20coordinates%20for%20a%20particular%20address%20or%20location.%20With%20the%20latitude%2Flongitude%20coordinates%20you%20can%20fun%20things%20like%20plot%20markers%20on%20a%20map%2C%20c" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;t=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;title=Geocoding%3A%20Location%20to%20Latitude%2FLongitude" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F&amp;submitHeadline=Geocoding%3A%20Location%20to%20Latitude%2FLongitude&amp;submitSummary=Both%20Google%20and%20Yahoo%20offer%20free%20geocoding%20services.%20Geocoding%20is%20the%20process%20of%20getting%20the%20latitude%2Flongitude%20coordinates%20for%20a%20particular%20address%20or%20location.%20With%20the%20latitude%2Flongitude%20coordinates%20you%20can%20fun%20things%20like%20plot%20markers%20on%20a%20map%2C%20c&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=Geocoding%3A%20Location%20to%20Latitude%2FLongitude&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fgeocoding-location-latitude-longitude%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/geocoding-location-latitude-longitude/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Screen Scraping</title>
		<link>http://www.bradino.com/php/php-screen-scraping/</link>
		<comments>http://www.bradino.com/php/php-screen-scraping/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 18:20:47 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Screen Scraping]]></category>

		<guid isPermaLink="false">http://www.bradino.com/php/php-screen-scraping/</guid>
		<description><![CDATA[I had a request recently for help with scraping a little content from http://www.newyork411.com :)
So here we go. This time I made a quick PHP class with some basic functions to grab the source fo the page as well as fetchBetween, fetchAfter, fetchAll, etc. You can get the latest version of the class at http://www.bradino.com/downloads/cScrape.txt [...]]]></description>
			<content:encoded><![CDATA[<p>I had a request recently for help with scraping a little content from http://www.newyork411.com :)</p>
<p>So here we go. This time I made a quick PHP class with some basic functions to grab the source fo the page as well as fetchBetween, fetchAfter, fetchAll, etc. You can get the latest version of the class at http://www.bradino.com/downloads/cScrape.txt - be sure to rename it to cScrape.php. If there is an interest I can continue to develop this class a tool for screens craping with PHP.</p>
<p>Anyway so here we go scraping all the companies from this page http://www.newyork411.com/Ad_Agencies_Production_Companies/category-cid-50553.htm as well as the details of each company, found by clicking on the company.</p>
<p><strong>Step 1 - Initialize the class and fetch the page:</strong></p>
<div class="syntax_hilite">
<div id="php-20">
<div class="php"><span style="color:#616100;">include</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'cScrape.php'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$scrape</span> = <span style="color:#000000; font-weight:bold;">new</span> Scrape<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$url</span> = <span style="color:#FF0000;">'http://www.newyork411.com/Ad_Agencies_Production_Companies/category-cid-50553.htm'</span>;</p>
<p><span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetch</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$data</span> = <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">removeNewlines</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p><strong>Step 2 - find your anchor and get the chunk of html that contains what you want</strong></p>
<div class="syntax_hilite">
<div id="php-21">
<div class="php"><span style="color:#0000FF;">$data</span> = <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetchBetween</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;table width=&quot;490&quot; border=&quot;0&quot; cellpadding=&quot;3&quot;'</span>,<span style="color:#FF0000;">'&lt;/table&gt;'</span>,<span style="color:#0000FF;">$data</span>,<span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#0000FF;">$rows</span> = <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetchAllBetween</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;TR'</span>,<span style="color:#FF0000;">'&lt;/tr&gt;'</span>,<span style="color:#0000FF;">$data</span>,<span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p><strong>Step 3 - parse out the individual values and print out the first record for demo</strong></p>
<div class="syntax_hilite">
<div id="php-22">
<div class="php"><span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rows</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$id</span> =&gt; <span style="color:#0000FF;">$row</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$record</span> = <a href="http://www.bradino.com/php-functions/array/"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$cells</span> = <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetchAllBetween</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;td'</span>,<span style="color:#FF0000;">'&lt;/td&gt;'</span>,<span style="color:#0000FF;">$row</span>,<span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'company'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/strip_tags/"><span style="color:#000066;">strip_tags</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cells</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$url</span> = <span style="color:#FF0000;">'http://www.newyork411.com'</span> . <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetchBetween</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;a href=&quot;'</span>,<span style="color:#FF0000;">'&quot;&gt;'</span>,<span style="color:#0000FF;">$cells</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$url</span> = <a href="http://www.bradino.com/php-functions/str_replace/"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">' '</span>,<span style="color:#FF0000;">'%20'</span>,<span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetch</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$data2</span> = <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">removeNewlines</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$data2</span> = <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetchBetween</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;div id=&quot;tabText&quot;&gt;'</span>,<span style="color:#FF0000;">'&lt;/div&gt;'</span>,<span style="color:#0000FF;">$data2</span>,<span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$data2</span> = <span style="color:#0000FF;">$scrape</span>-&gt;<span style="color:#006600;">fetchAfter</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;/table&gt;'</span>,<span style="color:#0000FF;">$data2</span>,<span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$details</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;br /&gt;'</span>,<span style="color:#0000FF;">$data2</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'address'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$details</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$location</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">','</span>,<span style="color:#0000FF;">$details</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'city'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/trim/"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$location</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$location</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">' '</span>,<a href="http://www.bradino.com/php-functions/trim/"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$location</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'state'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/trim/"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$location</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'zip'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/trim/"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$location</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#616100;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span>=<span style="color:#CC66CC;">2</span>; <span style="color:#0000FF;">$i</span>&lt;=<span style="color:#CC66CC;">5</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$detail</span> = <a href="http://www.bradino.com/php-functions/trim/"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$details</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/substr/"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$detail</span>,<span style="color:#CC66CC;">0</span>,<span style="color:#CC66CC;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#FF0000;">'Phone:'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'phone'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/str_replace/"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Phone: '</span>,<span style="color:#FF0000;">''</span>,<span style="color:#0000FF;">$detail</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">else</span> <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/substr/"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$detail</span>,<span style="color:#CC66CC;">0</span>,<span style="color:#CC66CC;">4</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#FF0000;">'Fax:'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'fax'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/str_replace/"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Fax: '</span>,<span style="color:#FF0000;">''</span>,<span style="color:#0000FF;">$detail</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">else</span> <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/substr/"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$detail</span>,<span style="color:#CC66CC;">0</span>,<span style="color:#CC66CC;">4</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#FF0000;">'Web:'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'web'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/strip_tags/"><span style="color:#000066;">strip_tags</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/str_replace/"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Web: '</span>,<span style="color:#FF0000;">''</span>,<span style="color:#0000FF;">$detail</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">else</span> <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/substr/"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$detail</span>,<span style="color:#CC66CC;">0</span>,<span style="color:#CC66CC;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#FF0000;">'Email:'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'email'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.bradino.com/php-functions/strip_tags/"><span style="color:#000066;">strip_tags</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/str_replace/"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Email: '</span>,<span style="color:#FF0000;">''</span>,<span style="color:#0000FF;">$detail</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <a href="http://www.bradino.com/php-functions/print_r/"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$record</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <a href="http://www.bradino.com/php-functions/die/"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</div>
</div>
<p></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/php scrape/" rel="tag">php scrape</a> <a href="http://www.bradino.com/search/screen scraping/" rel="tag">screen scraping</a> <a href="http://www.bradino.com/search/php screen scrape/" rel="tag">php screen scrape</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;t=PHP%20Screen%20Scraping%20" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;h=PHP%20Screen%20Scraping%20" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=PHP%20Screen%20Scraping%20&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;=PHP%20Screen%20Scraping%20" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;t=PHP%20Screen%20Scraping%20" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=I%20had%20a%20request%20recently%20for%20help%20with%20scraping%20a%20little%20content%20from%20http%3A%2F%2Fwww.newyork411.com%20%3A%29%0D%0A%0D%0ASo%20here%20we%20go.%20This%20time%20I%20made%20a%20quick%20PHP%20class%20with%20some%20basic%20functions%20to%20grab%20the%20source%20fo%20the%20page%20as%20well%20as%20fetchBetween%2C%20fetchAfter%2C%20fetc" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;t=PHP%20Screen%20Scraping%20" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;title=PHP%20Screen%20Scraping%20" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F&amp;submitHeadline=PHP%20Screen%20Scraping%20&amp;submitSummary=I%20had%20a%20request%20recently%20for%20help%20with%20scraping%20a%20little%20content%20from%20http%3A%2F%2Fwww.newyork411.com%20%3A%29%0D%0A%0D%0ASo%20here%20we%20go.%20This%20time%20I%20made%20a%20quick%20PHP%20class%20with%20some%20basic%20functions%20to%20grab%20the%20source%20fo%20the%20page%20as%20well%20as%20fetchBetween%2C%20fetchAfter%2C%20fetc&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=PHP%20Screen%20Scraping%20&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fphp-screen-scraping%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/php-screen-scraping/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Javascript Split Function</title>
		<link>http://www.bradino.com/javascript/split-function/</link>
		<comments>http://www.bradino.com/javascript/split-function/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 07:16:11 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.bradino.com/javascript/split-2/</guid>
		<description><![CDATA[The Javascript split() function works much the same as the php split() or explode() functions. Basically you take a string at break it up everywhere the delimiter character occurs and return the new strings in an array. So for example, let's say you have a string like this:


var colorString = "red&#124;orange&#124;blue&#124;white&#124;black&#124;brown";



Which is obviously a simple [...]]]></description>
			<content:encoded><![CDATA[<p>The Javascript split() function works much the same as the php split() or explode() functions. Basically you take a string at break it up everywhere the delimiter character occurs and return the new strings in an array. So for example, let's say you have a string like this:</p>
<div class="syntax_hilite">
<div id="javascript-26">
<div class="javascript"><span style="color: #003366; font-weight: bold;">var</span> colorString = <span style="color: #3366CC;">"red|orange|blue|white|black|brown"</span>;</div>
</div>
</div>
<p></p>
<p>Which is obviously a simple a pipe-delimited string of colors. So to make this into an array we would use the split function.</p>
<div class="syntax_hilite">
<div id="javascript-27">
<div class="javascript"><span style="color: #003366; font-weight: bold;">var</span> colorArray = colorString.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"|"</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>Now you have a simple array of colors and can access them as you would any array, either in a loop or by the numeric index, whatever...</p>
<div class="syntax_hilite">
<div id="javascript-28">
<div class="javascript"><span style="color: #003366; font-weight: bold;">var</span> message = <span style="color: #3366CC;">"My favorite color is "</span> + colorArray<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #66cc66;">&#93;</span> ;<br />
<span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>message<span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/javascript split/" rel="tag">javascript split</a> <a href="http://www.bradino.com/search/javascript explode/" rel="tag">javascript explode</a> <a href="http://www.bradino.com/search/split/" rel="tag">split</a> <a href="http://www.bradino.com/search/javascript string manipulation/" rel="tag">javascript string manipulation</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;t=Javascript%20Split%20Function" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;h=Javascript%20Split%20Function" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=Javascript%20Split%20Function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;=Javascript%20Split%20Function" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;t=Javascript%20Split%20Function" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=The%20Javascript%20split%28%29%20function%20works%20much%20the%20same%20as%20the%20php%20split%28%29%20or%20explode%28%29%20functions.%20Basically%20you%20take%20a%20string%20at%20break%20it%20up%20everywhere%20the%20delimiter%20character%20occurs%20and%20return%20the%20new%20strings%20in%20an%20array.%20So%20for%20example%2C%20let%27s%20say%20you%20" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;t=Javascript%20Split%20Function" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;title=Javascript%20Split%20Function" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F&amp;submitHeadline=Javascript%20Split%20Function&amp;submitSummary=The%20Javascript%20split%28%29%20function%20works%20much%20the%20same%20as%20the%20php%20split%28%29%20or%20explode%28%29%20functions.%20Basically%20you%20take%20a%20string%20at%20break%20it%20up%20everywhere%20the%20delimiter%20character%20occurs%20and%20return%20the%20new%20strings%20in%20an%20array.%20So%20for%20example%2C%20let%27s%20say%20you%20&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=Javascript%20Split%20Function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fsplit-function%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/javascript/split-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Mod Rewrite</title>
		<link>http://www.bradino.com/apache/mod-rewrite/</link>
		<comments>http://www.bradino.com/apache/mod-rewrite/#comments</comments>
		<pubDate>Sat, 24 Mar 2007 21:53:36 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.bradino.net/php/mod-rewrite/</guid>
		<description><![CDATA[One if the cleanest ways to setup a site is to use mod_rewrite in Apache. I am going to show you a simple way to do this using an htaccess file and a little PHP. First step is to make an htaccess file with the following code:
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?loc=$1
Now everything [...]]]></description>
			<content:encoded><![CDATA[<p>One if the cleanest ways to setup a site is to use mod_rewrite in Apache. I am going to show you a simple way to do this using an htaccess file and a little PHP. First step is to make an htaccess file with the following code:</p>
<p>RewriteEngine on<br />
RewriteCond %{SCRIPT_FILENAME} !-f<br />
RewriteCond %{SCRIPT_FILENAME} !-d<br />
RewriteRule ^(.*)$ index.php?loc=$1</p>
<p>Now everything that is not a folder or a file will get passed to the index.php file as $_GET['loc']. You could change the index.php to any file you like and the ?loc= to some other variable if you like.</p>
<p>Next you need to groom the url. Do not leave out this step. You are injecting the url into your script... I suggest something solid like the following:</p>
<div class="syntax_hilite">
<div id="php-31">
<div class="php"><span style="color:#000000; font-weight:bold;">&lt;?php</span><br />
<span style="color:#0000FF;">$url</span> = <a href="http://www.bradino.com/php-functions/preg_replace/"><span style="color:#000066;">preg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/[^[:alnum:]<span style="color:#000099; font-weight:bold;">\-</span><span style="color:#000099; font-weight:bold;">\/</span>]/'</span>, <span style="color:#FF0000;">''</span>, <span style="color:#0000FF;">$_GET</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'loc'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</div>
</div>
<p>
So now you have the url into your script safely so you need to break it apart. You are basically going to pass variables here. All you have to do is explode on the forward slash. You can do it simply like this:</p>
<div class="syntax_hilite">
<div id="php-32">
<div class="php"><span style="color:#000000; font-weight:bold;">&lt;?php</span><br />
<span style="color:#0000FF;">$parts</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/'</span>,<span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<span style="color:#0000FF;">$section</span> = <span style="color:#0000FF;">$parts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>;<br />
<span style="color:#0000FF;">$subsection</span> = <span style="color:#0000FF;">$parts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>;<br />
<span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</div>
</div>
<p></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/mod rewrite/" rel="tag">mod rewrite</a> <a href="http://www.bradino.com/search/modrewrite/" rel="tag">modrewrite</a> <a href="http://www.bradino.com/search/mod-rewrite/" rel="tag">mod-rewrite</a> <a href="http://www.bradino.com/search/apache/" rel="tag">apache</a> <a href="http://www.bradino.com/search/php/" rel="tag">php</a> <a href="http://www.bradino.com/search/clean urls/" rel="tag">clean urls</a> <a href="http://www.bradino.com/search/seo/" rel="tag">seo</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;t=Apache%20Mod%20Rewrite" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;h=Apache%20Mod%20Rewrite" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=Apache%20Mod%20Rewrite&amp;url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;=Apache%20Mod%20Rewrite" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;t=Apache%20Mod%20Rewrite" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=One%20if%20the%20cleanest%20ways%20to%20setup%20a%20site%20is%20to%20use%20mod_rewrite%20in%20Apache.%20I%20am%20going%20to%20show%20you%20a%20simple%20way%20to%20do%20this%20using%20an%20htaccess%20file%20and%20a%20little%20PHP.%20First%20step%20is%20to%20make%20an%20htaccess%20file%20with%20the%20following%20code%3A%0D%0A%0D%0ARewriteEngine%20on%0D%0ARew" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;t=Apache%20Mod%20Rewrite" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;title=Apache%20Mod%20Rewrite" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F&amp;submitHeadline=Apache%20Mod%20Rewrite&amp;submitSummary=One%20if%20the%20cleanest%20ways%20to%20setup%20a%20site%20is%20to%20use%20mod_rewrite%20in%20Apache.%20I%20am%20going%20to%20show%20you%20a%20simple%20way%20to%20do%20this%20using%20an%20htaccess%20file%20and%20a%20little%20PHP.%20First%20step%20is%20to%20make%20an%20htaccess%20file%20with%20the%20following%20code%3A%0D%0A%0D%0ARewriteEngine%20on%0D%0ARew&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=Apache%20Mod%20Rewrite&amp;body=http%3A%2F%2Fwww.bradino.com%2Fapache%2Fmod-rewrite%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/apache/mod-rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP chunk_split function</title>
		<link>http://www.bradino.com/php-functions/chunk_split/</link>
		<comments>http://www.bradino.com/php-functions/chunk_split/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 05:19:57 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[chunk_split    (PHP 3 &#62;= 3.0.6, PHP 4, PHP 5)chunk_split -- Split a string into smaller chunksDescriptionstring chunk_split ( string body [, int chunklen [, string end]] )&#13;     Can be used to split a string into smaller chunks which is useful for
     e.g. converting base64_encode() [...]]]></description>
			<content:encoded><![CDATA[<p>chunk_split<P>    (PHP 3 &#62;= 3.0.6, PHP 4, PHP 5)</P>chunk_split -- Split a string into smaller chunksDescriptionstring chunk_split ( string body [, int chunklen [, string end]] )<BR></BR><P>&#13;     Can be used to split a string into smaller chunks which is useful for<br />
     e.g. converting base64_encode() output to match RFC<br />
     2045 semantics. It inserts end (defaults to<br />
     "\r\n") every chunklen characters (defaults to<br />
     76). It returns the new string leaving the original string untouched.<br />
     <P>Example 1. chunk_split() example</P></p>
<div class="syntax_hilite">
<div id="php-34">
<div class="php"><span style="color:#FF9933; font-style:italic;">// format $data using RFC 2045 semantics</span><br />
<span style="color:#0000FF;">$new_string</span> = <a href="http://www.bradino.com/php-functions/chunk_split/"><span style="color:#000066;">chunk_split</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/base64_encode/"><span style="color:#000066;">base64_encode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>    </P><P>&#13;     See also str_split(),<br />
     explode(), split(),<br />
     wordwrap() and<br />
     RFC 2045.<br />
    </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/chunk_split/" rel="tag">chunk_split</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/chunk_split function/" rel="tag">chunk_split function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP chunk_split function/" rel="tag">PHP chunk_split function</a> <a href="http://www.bradino.com/search/mysql/" rel="tag">mysql</a> <a href="http://www.bradino.com/search/php tutorials/" rel="tag">php tutorials</a> <a href="http://www.bradino.com/search/apache/" rel="tag">apache</a> <a href="http://www.bradino.com/search/php manual/" rel="tag">php manual</a> <a href="http://www.bradino.com/search/server/" rel="tag">server</a> <a href="http://www.bradino.com/search/database/" rel="tag">database</a> <a href="http://www.bradino.com/search/flash/" rel="tag">flash</a> <a href="http://www.bradino.com/search/content management system/" rel="tag">content management system</a> <a href="http://www.bradino.com/search/sql/" rel="tag">sql</a> <a href="http://www.bradino.com/search/script/" rel="tag">script</a> <a href="http://www.bradino.com/search/string/" rel="tag">string</a> <a href="http://www.bradino.com/search/xml/" rel="tag">xml</a> <a href="http://www.bradino.com/search/regular expressions/" rel="tag">regular expressions</a> <a href="http://www.bradino.com/search/php5/" rel="tag">php5</a> <a href="http://www.bradino.com/search/code/" rel="tag">code</a> <a href="http://www.bradino.com/search/classes/" rel="tag">classes</a> <a href="http://www.bradino.com/search/developers/" rel="tag">developers</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;t=PHP%20chunk_split%20function" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;h=PHP%20chunk_split%20function" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=PHP%20chunk_split%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;=PHP%20chunk_split%20function" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;t=PHP%20chunk_split%20function" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=chunk_split%20%20%20%20%28PHP%203%20%26%2362%3B%3D%203.0.6%2C%20PHP%204%2C%20PHP%205%29chunk_split%20--%20Split%20a%20string%20into%20smaller%20chunksDescriptionstring%20chunk_split%20%28%20string%20body%20%5B%2C%20int%20chunklen%20%5B%2C%20string%20end%5D%5D%20%29%26%2313%3B%20%20%20%20%20Can%20be%20used%20to%20split%20a%20string%20into%20smaller%20chunks%20which%20is%20useful" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;t=PHP%20chunk_split%20function" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;title=PHP%20chunk_split%20function" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F&amp;submitHeadline=PHP%20chunk_split%20function&amp;submitSummary=chunk_split%20%20%20%20%28PHP%203%20%26%2362%3B%3D%203.0.6%2C%20PHP%204%2C%20PHP%205%29chunk_split%20--%20Split%20a%20string%20into%20smaller%20chunksDescriptionstring%20chunk_split%20%28%20string%20body%20%5B%2C%20int%20chunklen%20%5B%2C%20string%20end%5D%5D%20%29%26%2313%3B%20%20%20%20%20Can%20be%20used%20to%20split%20a%20string%20into%20smaller%20chunks%20which%20is%20useful&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=PHP%20chunk_split%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fchunk_split%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php-functions/chunk_split/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP explode function</title>
		<link>http://www.bradino.com/php-functions/explode/</link>
		<comments>http://www.bradino.com/php-functions/explode/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 05:10:36 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[explode    (PHP 3, PHP 4, PHP 5)explode -- Split a string by stringDescriptionarray explode ( string delimiter, string string [, int limit] )&#13;     Returns an array of strings, each of which is a substring of
     string formed by splitting it on
    [...]]]></description>
			<content:encoded><![CDATA[<p>explode<P>    (PHP 3, PHP 4, PHP 5)</P>explode -- Split a string by stringDescriptionarray explode ( string delimiter, string string [, int limit] )<BR></BR><P>&#13;     Returns an array of strings, each of which is a substring of<br />
     string formed by splitting it on<br />
     boundaries formed by the string delimiter.<br />
     If limit is set, the returned array will<br />
     contain a maximum of limit elements with<br />
     the last element containing the rest of<br />
     string.<br />
    </P><P>&#13;     If delimiter is an empty string (""),<br />
     explode() will return FALSE.  If<br />
     delimiter contains a value that is not contained<br />
     in string, then explode() will<br />
     return an array containing string.<br />
    </P><P>&#13;     If the limit parameter is negative, all components<br />
     except the last -limit are returned. This feature<br />
     was added in PHP 5.1.0.<br />
    </P><P>&#13;     Although implode() can, for historical reasons,<br />
     accept its parameters in either order,<br />
     explode() cannot. You must ensure that the<br />
     delimiter argument comes before the<br />
     string argument.<br />
    </P><P>Note:<br />
      The limit parameter was added in PHP<br />
      4.0.1<br />
     </P><P>&#13;     <P>Example 1. explode() examples</P></p>
<div class="syntax_hilite">
<div id="php-37">
<div class="php"><span style="color:#FF9933; font-style:italic;">// Example 1</span><br />
<span style="color:#0000FF;">$pizza</span>&nbsp; = <span style="color:#FF0000;">"piece1 piece2 piece3 piece4 piece5 piece6"</span>;<br />
<span style="color:#0000FF;">$pieces</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">" "</span>, <span style="color:#0000FF;">$pizza</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$pieces</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>; <span style="color:#FF9933; font-style:italic;">// piece1</span><br />
<a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$pieces</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>; <span style="color:#FF9933; font-style:italic;">// piece2</span></p>
<p><span style="color:#FF9933; font-style:italic;">// Example 2</span><br />
<span style="color:#0000FF;">$data</span> = <span style="color:#FF0000;">"foo:*:1023:1000::/home/foo:/bin/sh"</span>;<br />
<a href="http://www.bradino.com/php-functions/list/"><span style="color:#000066;">list</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$user</span>, <span style="color:#0000FF;">$pass</span>, <span style="color:#0000FF;">$uid</span>, <span style="color:#0000FF;">$gid</span>, <span style="color:#0000FF;">$gecos</span>, <span style="color:#0000FF;">$home</span>, <span style="color:#0000FF;">$shell</span><span style="color:#006600; font-weight:bold;">&#41;</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">":"</span>, <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$user</span>; <span style="color:#FF9933; font-style:italic;">// foo</span><br />
<a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$pass</span>; <span style="color:#FF9933; font-style:italic;">// * </span></div>
</div>
</div>
<p></p>
<p>    </P><P>&#13;     <P>Example 2. limit parameter examples</P></p>
<div class="syntax_hilite">
<div id="php-38">
<div class="php"><span style="color:#0000FF;">$str</span> = <span style="color:#FF0000;">'one|two|three|four'</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// positive limit</span><br />
<a href="http://www.bradino.com/php-functions/print_r/"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'|'</span>, <span style="color:#0000FF;">$str</span>, <span style="color:#CC66CC;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// negative limit (since PHP 5.1)</span><br />
<a href="http://www.bradino.com/php-functions/print_r/"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'|'</span>, <span style="color:#0000FF;">$str</span>, -<span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p><P>The above example will output:</P>Array<br />
(<br />
    [0] =&#62; one<br />
    [1] =&#62; two|three|four<br />
)<br />
Array<br />
(<br />
    [0] =&#62; one<br />
    [1] =&#62; two<br />
    [2] =&#62; three<br />
)<br />
    </P><P>Note: This function is<br />
binary-safe.</P><P>&#13;     See also<br />
     preg_split(),<br />
     str_split(),<br />
     strtok(), and<br />
     implode().<br />
    </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/explode/" rel="tag">explode</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/explode function/" rel="tag">explode function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP explode function/" rel="tag">PHP explode function</a> <a href="http://www.bradino.com/search/mysql/" rel="tag">mysql</a> <a href="http://www.bradino.com/search/php tutorials/" rel="tag">php tutorials</a> <a href="http://www.bradino.com/search/apache/" rel="tag">apache</a> <a href="http://www.bradino.com/search/php manual/" rel="tag">php manual</a> <a href="http://www.bradino.com/search/server/" rel="tag">server</a> <a href="http://www.bradino.com/search/database/" rel="tag">database</a> <a href="http://www.bradino.com/search/flash/" rel="tag">flash</a> <a href="http://www.bradino.com/search/content management system/" rel="tag">content management system</a> <a href="http://www.bradino.com/search/sql/" rel="tag">sql</a> <a href="http://www.bradino.com/search/script/" rel="tag">script</a> <a href="http://www.bradino.com/search/string/" rel="tag">string</a> <a href="http://www.bradino.com/search/xml/" rel="tag">xml</a> <a href="http://www.bradino.com/search/regular expressions/" rel="tag">regular expressions</a> <a href="http://www.bradino.com/search/php5/" rel="tag">php5</a> <a href="http://www.bradino.com/search/code/" rel="tag">code</a> <a href="http://www.bradino.com/search/classes/" rel="tag">classes</a> <a href="http://www.bradino.com/search/developers/" rel="tag">developers</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;t=PHP%20explode%20function" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;h=PHP%20explode%20function" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=PHP%20explode%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;=PHP%20explode%20function" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;t=PHP%20explode%20function" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=explode%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29explode%20--%20Split%20a%20string%20by%20stringDescriptionarray%20explode%20%28%20string%20delimiter%2C%20string%20string%20%5B%2C%20int%20limit%5D%20%29%26%2313%3B%20%20%20%20%20Returns%20an%20array%20of%20strings%2C%20each%20of%20which%20is%20a%20substring%20of%0A%20%20%20%20%20string%20formed%20by%20splitting%20it%20on%0A" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;t=PHP%20explode%20function" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;title=PHP%20explode%20function" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F&amp;submitHeadline=PHP%20explode%20function&amp;submitSummary=explode%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29explode%20--%20Split%20a%20string%20by%20stringDescriptionarray%20explode%20%28%20string%20delimiter%2C%20string%20string%20%5B%2C%20int%20limit%5D%20%29%26%2313%3B%20%20%20%20%20Returns%20an%20array%20of%20strings%2C%20each%20of%20which%20is%20a%20substring%20of%0A%20%20%20%20%20string%20formed%20by%20splitting%20it%20on%0A&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=PHP%20explode%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fexplode%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php-functions/explode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP fbsql_field_flags function</title>
		<link>http://www.bradino.com/php-functions/fbsql_field_flags/</link>
		<comments>http://www.bradino.com/php-functions/fbsql_field_flags/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 05:09:56 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[fbsql_field_flags    (PHP 4 &#62;= 4.0.6, PHP 5)fbsql_field_flags -- Get the flags associated with the specified field in a resultDescriptionstring fbsql_field_flags ( resource result [, int field_offset] )&#13;   Gets the flags associated with the specified field in a result.
  Parameters&#13;   result&#13;       A [...]]]></description>
			<content:encoded><![CDATA[<p>fbsql_field_flags<P>    (PHP 4 &#62;= 4.0.6, PHP 5)</P>fbsql_field_flags -- Get the flags associated with the specified field in a resultDescriptionstring fbsql_field_flags ( resource result [, int field_offset] )<BR></BR><P>&#13;   Gets the flags associated with the specified field in a result.<br />
  </P>Parameters<P>&#13;   <P></P>result<P>&#13;       A result pointer returned by fbsql_list_fields().<br />
      </P>field_offset<P>&#13;       The numerical offset of the field. The field index starts at 0.<br />
      </P><br />
  </P>Return Values<P>&#13;   Returns the field flags of the specified field as a single word per flag<br />
   separated by a single space, so that you can split the returned value<br />
   using explode().<br />
  </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/fbsql_field_flags/" rel="tag">fbsql_field_flags</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/fbsql_field_flags function/" rel="tag">fbsql_field_flags function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP fbsql_field_flags function/" rel="tag">PHP fbsql_field_flags function</a> <a href="http://www.bradino.com/search/mysql/" rel="tag">mysql</a> <a href="http://www.bradino.com/search/php tutorials/" rel="tag">php tutorials</a> <a href="http://www.bradino.com/search/apache/" rel="tag">apache</a> <a href="http://www.bradino.com/search/php manual/" rel="tag">php manual</a> <a href="http://www.bradino.com/search/server/" rel="tag">server</a> <a href="http://www.bradino.com/search/database/" rel="tag">database</a> <a href="http://www.bradino.com/search/flash/" rel="tag">flash</a> <a href="http://www.bradino.com/search/content management system/" rel="tag">content management system</a> <a href="http://www.bradino.com/search/sql/" rel="tag">sql</a> <a href="http://www.bradino.com/search/script/" rel="tag">script</a> <a href="http://www.bradino.com/search/string/" rel="tag">string</a> <a href="http://www.bradino.com/search/xml/" rel="tag">xml</a> <a href="http://www.bradino.com/search/regular expressions/" rel="tag">regular expressions</a> <a href="http://www.bradino.com/search/php5/" rel="tag">php5</a> <a href="http://www.bradino.com/search/code/" rel="tag">code</a> <a href="http://www.bradino.com/search/classes/" rel="tag">classes</a> <a href="http://www.bradino.com/search/developers/" rel="tag">developers</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;t=PHP%20fbsql_field_flags%20function" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;h=PHP%20fbsql_field_flags%20function" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=PHP%20fbsql_field_flags%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;=PHP%20fbsql_field_flags%20function" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;t=PHP%20fbsql_field_flags%20function" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=fbsql_field_flags%20%20%20%20%28PHP%204%20%26%2362%3B%3D%204.0.6%2C%20PHP%205%29fbsql_field_flags%20--%20Get%20the%20flags%20associated%20with%20the%20specified%20field%20in%20a%20resultDescriptionstring%20fbsql_field_flags%20%28%20resource%20result%20%5B%2C%20int%20field_offset%5D%20%29%26%2313%3B%20%20%20Gets%20the%20flags%20associated%20with%20the%20s" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;t=PHP%20fbsql_field_flags%20function" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;title=PHP%20fbsql_field_flags%20function" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F&amp;submitHeadline=PHP%20fbsql_field_flags%20function&amp;submitSummary=fbsql_field_flags%20%20%20%20%28PHP%204%20%26%2362%3B%3D%204.0.6%2C%20PHP%205%29fbsql_field_flags%20--%20Get%20the%20flags%20associated%20with%20the%20specified%20field%20in%20a%20resultDescriptionstring%20fbsql_field_flags%20%28%20resource%20result%20%5B%2C%20int%20field_offset%5D%20%29%26%2313%3B%20%20%20Gets%20the%20flags%20associated%20with%20the%20s&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=PHP%20fbsql_field_flags%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffbsql_field_flags%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php-functions/fbsql_field_flags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP fgetcsv function</title>
		<link>http://www.bradino.com/php-functions/fgetcsv/</link>
		<comments>http://www.bradino.com/php-functions/fgetcsv/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 05:08:45 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[fgetcsv    (PHP 3 &#62;= 3.0.8, PHP 4, PHP 5)fgetcsv -- Gets line from file pointer and parse for CSV fieldsDescriptionarray fgetcsv ( resource handle [, int length [, string delimiter [, string enclosure]]] )&#13;   handle&#13;       A valid file pointer to a file successfully opened [...]]]></description>
			<content:encoded><![CDATA[<p>fgetcsv<P>    (PHP 3 &#62;= 3.0.8, PHP 4, PHP 5)</P>fgetcsv -- Gets line from file pointer and parse for CSV fieldsDescriptionarray fgetcsv ( resource handle [, int length [, string delimiter [, string enclosure]]] )<BR></BR><P>&#13;   <P></P>handle<P>&#13;       A valid file pointer to a file successfully opened by fopen(),<br />
       popen(), or fsockopen().<br />
      </P>length (Optional)<P>&#13;       Must be greater than the longest line (in characters) to be found in the CSV file<br />
       (allowing for trailing line-end characters). It became optional in PHP 5. Omitting<br />
       this parameter (or setting it to 0 in PHP 5.0.4 and later) the maximum line length<br />
       is not limited, which is slightly slower.<br />
      </P>delimiter (Optional)<P>&#13;       Set the field delimiter (one character only). Defaults as a comma.<br />
      </P>enclosure (Optional)<P>&#13;       Set the field enclosure character (one character only). Defaults as a double quotation mark. Added in PHP 4.3.0.<br />
      </P><br />
  </P><P>&#13;   Similar to fgets() except that<br />
   fgetcsv() parses the line it reads for fields<br />
   in CSV format and returns an array containing<br />
   the fields read.<br />
  </P><P>&#13;   fgetcsv() returns FALSE on error, including<br />
   end of file.<br />
  </P><P>Note:<br />
    A blank line in a CSV file will be returned as an array<br />
    comprising a single null field, and will not be treated<br />
    as an error.<br />
   </P><P>&#13;   <P>Example 1. Read and print the entire contents of a CSV file</P></p>
<div class="syntax_hilite">
<div id="php-40">
<div class="php"><span style="color:#0000FF;">$row</span> = <span style="color:#CC66CC;">1</span>;<br />
<span style="color:#0000FF;">$handle</span> = <a href="http://www.bradino.com/php-functions/fopen/"><span style="color:#000066;">fopen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"test.csv"</span>, <span style="color:#FF0000;">"r"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span> = <a href="http://www.bradino.com/php-functions/fgetcsv/"><span style="color:#000066;">fgetcsv</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$handle</span>, <span style="color:#CC66CC;">1000</span>, <span style="color:#FF0000;">","</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> !== <span style="color:#000000; font-weight:bold;">FALSE</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color:#0000FF;">$num</span> = <a href="http://www.bradino.com/php-functions/count/"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&amp;lt;p&amp;gt; $num fields in line $row: &amp;lt;br /&amp;gt;&amp;lt;/p&amp;gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$row</span>++;<br />
&nbsp; &nbsp; <span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$c</span>=<span style="color:#CC66CC;">0</span>; <span style="color:#0000FF;">$c</span> &amp;lt;<span style="color:#0000FF;">$num</span>; <span style="color:#0000FF;">$c</span>++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$c</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#FF0000;">"&amp;lt;br /&amp;gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<a href="http://www.bradino.com/php-functions/fclose/"><span style="color:#000066;">fclose</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$handle</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>  </P><P>&#13;   fgetcsv() has been binary safe since PHP 4.3.5<br />
  </P><P>Note:<br />
    Locale setting is taken into account by this function. If<br />
    LANG is e.g. en_US.UTF-8, files in<br />
    one-byte encoding are read wrong by this function.<br />
   </P><P>Note: If you are having problems<br />
with PHP not recognizing the line endings when reading files either on or<br />
created by a Macintosh computer, you might want to enable the<br />
auto_detect_line_endings<br />
run-time configuration option.</P><P>&#13;   See also explode(), file(),<br />
   pack() and fputcsv().<br />
  </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/fgetcsv/" rel="tag">fgetcsv</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/fgetcsv function/" rel="tag">fgetcsv function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP fgetcsv function/" rel="tag">PHP fgetcsv function</a> <a href="http://www.bradino.com/search/mysql/" rel="tag">mysql</a> <a href="http://www.bradino.com/search/php tutorials/" rel="tag">php tutorials</a> <a href="http://www.bradino.com/search/apache/" rel="tag">apache</a> <a href="http://www.bradino.com/search/php manual/" rel="tag">php manual</a> <a href="http://www.bradino.com/search/server/" rel="tag">server</a> <a href="http://www.bradino.com/search/database/" rel="tag">database</a> <a href="http://www.bradino.com/search/flash/" rel="tag">flash</a> <a href="http://www.bradino.com/search/content management system/" rel="tag">content management system</a> <a href="http://www.bradino.com/search/sql/" rel="tag">sql</a> <a href="http://www.bradino.com/search/script/" rel="tag">script</a> <a href="http://www.bradino.com/search/string/" rel="tag">string</a> <a href="http://www.bradino.com/search/xml/" rel="tag">xml</a> <a href="http://www.bradino.com/search/regular expressions/" rel="tag">regular expressions</a> <a href="http://www.bradino.com/search/php5/" rel="tag">php5</a> <a href="http://www.bradino.com/search/code/" rel="tag">code</a> <a href="http://www.bradino.com/search/classes/" rel="tag">classes</a> <a href="http://www.bradino.com/search/developers/" rel="tag">developers</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;t=PHP%20fgetcsv%20function" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;h=PHP%20fgetcsv%20function" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=PHP%20fgetcsv%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;=PHP%20fgetcsv%20function" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;t=PHP%20fgetcsv%20function" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=fgetcsv%20%20%20%20%28PHP%203%20%26%2362%3B%3D%203.0.8%2C%20PHP%204%2C%20PHP%205%29fgetcsv%20--%20Gets%20line%20from%20file%20pointer%20and%20parse%20for%20CSV%20fieldsDescriptionarray%20fgetcsv%20%28%20resource%20handle%20%5B%2C%20int%20length%20%5B%2C%20string%20delimiter%20%5B%2C%20string%20enclosure%5D%5D%5D%20%29%26%2313%3B%20%20%20handle%26%2313%3B%20%20%20%20%20%20%20A%20valid%20file%20po" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;t=PHP%20fgetcsv%20function" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;title=PHP%20fgetcsv%20function" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F&amp;submitHeadline=PHP%20fgetcsv%20function&amp;submitSummary=fgetcsv%20%20%20%20%28PHP%203%20%26%2362%3B%3D%203.0.8%2C%20PHP%204%2C%20PHP%205%29fgetcsv%20--%20Gets%20line%20from%20file%20pointer%20and%20parse%20for%20CSV%20fieldsDescriptionarray%20fgetcsv%20%28%20resource%20handle%20%5B%2C%20int%20length%20%5B%2C%20string%20delimiter%20%5B%2C%20string%20enclosure%5D%5D%5D%20%29%26%2313%3B%20%20%20handle%26%2313%3B%20%20%20%20%20%20%20A%20valid%20file%20po&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=PHP%20fgetcsv%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Ffgetcsv%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php-functions/fgetcsv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP imap_thread function</title>
		<link>http://www.bradino.com/php-functions/imap_thread/</link>
		<comments>http://www.bradino.com/php-functions/imap_thread/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 04:57:45 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[imap_thread    (PHP 4 &#62;= 4.1.0, PHP 5)imap_thread -- Returns a tree of threaded messageDescriptionarray imap_thread ( resource imap_stream [, int options] )&#13;   Gets a tree of a threaded message.
  Parameters&#13;   &#13;imap_streamAn IMAP stream returned by
imap_open().options&#13;      
  Return Values&#13;   imap_thread() [...]]]></description>
			<content:encoded><![CDATA[<p>imap_thread<P>    (PHP 4 &#62;= 4.1.0, PHP 5)</P>imap_thread -- Returns a tree of threaded messageDescriptionarray imap_thread ( resource imap_stream [, int options] )<BR></BR><P>&#13;   Gets a tree of a threaded message.<br />
  </P>Parameters<P>&#13;   <P></P>&#13;imap_stream<P>An IMAP stream returned by<br />
imap_open().</P>options<P>&#13;      </P><br />
  </P>Return Values<P>&#13;   imap_thread() returns an associative array containing<br />
   a tree of messages threaded by REFERENCES, or FALSE<br />
   on error.<br />
  </P><P>&#13;   Every message in the current mailbox will be represented by three entries<br />
   in the resulting array:<br />
   <P></P><P>&#13;     $thread["XX.num"] - current message number<br />
    </P><P>&#13;     $thread["XX.next"]<br />
    </P><P>&#13;     $thread["XX.branch"]<br />
    </P><br />
  </P>Examples<P>&#13;   <P>Example 1. imap_thread() Example</P></p>
<div class="syntax_hilite">
<div id="php-42">
<div class="php"><span style="color:#FF9933; font-style:italic;">// Here we're outputting the threads of a newsgroup, in HTML</span></p>
<p><span style="color:#0000FF;">$nntp</span> = imap_open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'{news.example.com:119/nntp}some.newsgroup'</span>, <span style="color:#FF0000;">''</span>, <span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<span style="color:#0000FF;">$threads</span> = imap_thread<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$nntp</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$threads</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$key</span> =&amp;gt; <span style="color:#0000FF;">$val</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; <span style="color:#0000FF;">$tree</span> = <a href="http://www.bradino.com/php-functions/explode/"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'.'</span>, <span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tree</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#FF0000;">'num'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color:#0000FF;">$header</span> = imap_headerinfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$nntp</span>, <span style="color:#0000FF;">$val</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&amp;lt;ul&amp;gt;<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\t</span>&amp;lt;li&amp;gt;"</span> . <span style="color:#0000FF;">$header</span>-&amp;gt;fromaddress . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">elseif</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tree</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#FF0000;">'branch'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\t</span>&amp;lt;/li&amp;gt;<span style="color:#000099; font-weight:bold;">\n</span>&amp;lt;/ul&amp;gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><br />
<span style="color:#006600; font-weight:bold;">&#125;</span></p>
<p>imap_close<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$nntp</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>  </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/imap_thread/" rel="tag">imap_thread</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/imap_thread function/" rel="tag">imap_thread function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP imap_thread function/" rel="tag">PHP imap_thread function</a> <a href="http://www.bradino.com/search/mysql/" rel="tag">mysql</a> <a href="http://www.bradino.com/search/php tutorials/" rel="tag">php tutorials</a> <a href="http://www.bradino.com/search/apache/" rel="tag">apache</a> <a href="http://www.bradino.com/search/php manual/" rel="tag">php manual</a> <a href="http://www.bradino.com/search/server/" rel="tag">server</a> <a href="http://www.bradino.com/search/database/" rel="tag">database</a> <a href="http://www.bradino.com/search/flash/" rel="tag">flash</a> <a href="http://www.bradino.com/search/content management system/" rel="tag">content management system</a> <a href="http://www.bradino.com/search/sql/" rel="tag">sql</a> <a href="http://www.bradino.com/search/script/" rel="tag">script</a> <a href="http://www.bradino.com/search/string/" rel="tag">string</a> <a href="http://www.bradino.com/search/xml/" rel="tag">xml</a> <a href="http://www.bradino.com/search/regular expressions/" rel="tag">regular expressions</a> <a href="http://www.bradino.com/search/php5/" rel="tag">php5</a> <a href="http://www.bradino.com/search/code/" rel="tag">code</a> <a href="http://www.bradino.com/search/classes/" rel="tag">classes</a> <a href="http://www.bradino.com/search/developers/" rel="tag">developers</a></div>
<div class="sociable">

<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="Digg"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://twitter.com/home?status=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F" title="TwitThis"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="del.icio.us"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function&amp;popup=no" title="Netvouz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="description"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="Reddit"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;t=PHP%20imap_thread%20function" title="Furl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/furl.png" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;h=PHP%20imap_thread%20function" title="NewsVine"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.simpy.com/simpy/LinkAdd.do?href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="Simpy"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/simpy.png" title="Simpy" alt="Simpy" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?title=PHP%20imap_thread%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F" title="Slashdot"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="Spurl"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/spurl.png" title="Spurl" alt="Spurl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="StumbleUpon"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;=PHP%20imap_thread%20function" title="YahooMyWeb"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://tailrank.com/share/?text=&amp;link_href=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="TailRank"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/tailrank.png" title="TailRank" alt="TailRank" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F" title="Technorati"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;t=PHP%20imap_thread%20function" title="Facebook"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="Google"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google" alt="Google" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=imap_thread%20%20%20%20%28PHP%204%20%26%2362%3B%3D%204.1.0%2C%20PHP%205%29imap_thread%20--%20Returns%20a%20tree%20of%20threaded%20messageDescriptionarray%20imap_thread%20%28%20resource%20imap_stream%20%5B%2C%20int%20options%5D%20%29%26%2313%3B%20%20%20Gets%20a%20tree%20of%20a%20threaded%20message.%0A%20%20Parameters%26%2313%3B%20%20%20%26%2313%3Bimap_streamAn%20IMAP%20str" title="LinkedIn"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="Live"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;t=PHP%20imap_thread%20function" title="MySpace"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;title=PHP%20imap_thread%20function" title="Ping.fm"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/ping.gif" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F&amp;submitHeadline=PHP%20imap_thread%20function&amp;submitSummary=imap_thread%20%20%20%20%28PHP%204%20%26%2362%3B%3D%204.1.0%2C%20PHP%205%29imap_thread%20--%20Returns%20a%20tree%20of%20threaded%20messageDescriptionarray%20imap_thread%20%28%20resource%20imap_stream%20%5B%2C%20int%20options%5D%20%29%26%2313%3B%20%20%20Gets%20a%20tree%20of%20a%20threaded%20message.%0A%20%20Parameters%26%2313%3B%20%20%20%26%2313%3Bimap_streamAn%20IMAP%20str&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/yahoobuzz.gif" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="mailto:?subject=PHP%20imap_thread%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fimap_thread%2F" title="E-mail this story to a friend!"><img src="http://www.bradino.com/wp-content/plugins/sociable/images/email_link.png" title="E-mail this story to a friend!" alt="E-mail this story to a friend!" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php-functions/imap_thread/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
