<?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;  str_replace function</title>
	<atom:link href="http://www.bradino.com/?s=str_replace%20function&#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>Spanish Character Translation</title>
		<link>http://www.bradino.com/php/spanish-character-translation/</link>
		<comments>http://www.bradino.com/php/spanish-character-translation/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 22:15:43 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4803</guid>
		<description><![CDATA[If you have a quick and dirty need to translate Spanish Characters into HTML codes you could use this function. Basically just uses an array where the key is the Spanish Character and the Value is the corresponding HTML code. This makes it easy to extend to cover any other character translation you need. 


function [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a quick and dirty need to translate Spanish Characters into HTML codes you could use this function. Basically just uses an array where the key is the Spanish Character and the Value is the corresponding HTML code. This makes it easy to extend to cover any other character translation you need. </p>
<div class="syntax_hilite">
<div id="php-2">
<div class="php"><span style="color:#000000; font-weight:bold;">function</span> handleSpanishCharacters<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$input</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></p>
<p>&nbsp; &nbsp; <span style="color:#0000FF;">$translate</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; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Á'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#193;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'É'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#201;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Í'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#205;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Ó'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#211;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Ú'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#218;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Ñ'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#209;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Ü'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#220;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'á'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#225;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'é'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#237;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'í'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#233;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'ó'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#243;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'ú'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#250;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'ñ'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#241;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'ü'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#252;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'¿'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#191;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'¡'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#161;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'«'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#171;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'»'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#187;"</span>;<br />
&nbsp; &nbsp; <span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'€'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">"&amp;#128;"</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$search</span> = <a href="http://www.bradino.com/php-functions/array_keys/"><span style="color:#000066;">array_keys</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#0000FF;">$replace</span> = <a href="http://www.bradino.com/php-functions/array_values/"><span style="color:#000066;">array_values</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$translate</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#616100;">return</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:#0000FF;">$search</span>,<span style="color:#0000FF;">$replace</span>,<span style="color:#0000FF;">$input</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="awmp_tags"><a href="http://www.bradino.com/search/spanish characters/" rel="tag">spanish characters</a> <a href="http://www.bradino.com/search/htmlcodes/" rel="tag">htmlcodes</a> <a href="http://www.bradino.com/search/translate spanish characters/" rel="tag">translate spanish characters</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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation&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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;t=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;h=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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=Spanish%20Character%20Translation&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fspanish-character-translation%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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%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%2Fspanish-character-translation%2F&amp;t=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=If%20you%20have%20a%20quick%20and%20dirty%20need%20to%20translate%20Spanish%20Characters%20into%20HTML%20codes%20you%20could%20use%20this%20function.%20Basically%20just%20uses%20an%20array%20where%20the%20key%20is%20the%20Spanish%20Character%20and%20the%20Value%20is%20the%20corresponding%20HTML%20code.%20This%20makes%20it%20easy%20to%20ex" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;t=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;title=Spanish%20Character%20Translation" 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%2Fspanish-character-translation%2F&amp;submitHeadline=Spanish%20Character%20Translation&amp;submitSummary=If%20you%20have%20a%20quick%20and%20dirty%20need%20to%20translate%20Spanish%20Characters%20into%20HTML%20codes%20you%20could%20use%20this%20function.%20Basically%20just%20uses%20an%20array%20where%20the%20key%20is%20the%20Spanish%20Character%20and%20the%20Value%20is%20the%20corresponding%20HTML%20code.%20This%20makes%20it%20easy%20to%20ex&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=Spanish%20Character%20Translation&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp%2Fspanish-character-translation%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/spanish-character-translation/feed/</wfw:commentRss>
		<slash:comments>2</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-6">
<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-7">
<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-8">
<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-12">
<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-13">
<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-14">
<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 String Replace All</title>
		<link>http://www.bradino.com/javascript/string-replace/</link>
		<comments>http://www.bradino.com/javascript/string-replace/#comments</comments>
		<pubDate>Sun, 25 Mar 2007 22:57:56 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.bradino.com/javascript/string-replace/</guid>
		<description><![CDATA[The JavaScript function for String Replace replaces the first occurrence in the string. The function is similar to the php function str_replace and takes two simple parameters. The first parameter is the pattern to find and the second parameter is the string to replace the pattern with when found. The javascript function does not Replace [...]]]></description>
			<content:encoded><![CDATA[<p>The JavaScript function for String Replace replaces the first occurrence in the string. The function is similar to the php function str_replace and takes two simple parameters. The first parameter is the pattern to find and the second parameter is the string to replace the pattern with when found. The javascript function does not Replace All...</p>
<div class="syntax_hilite">
<div id="javascript-17">
<div class="javascript">str = str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>”find”,”replace”<span style="color: #66cc66;">&#41;</span></div>
</div>
</div>
<p></p>
<p>To ReplaceAll you have to do it a little differently. To replace all occurrences in the string, use the g modifier like this:</p>
<div class="syntax_hilite">
<div id="javascript-18">
<div class="javascript">str = str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066FF;">/find/g</span>,”replace”<span style="color: #66cc66;">&#41;</span></div>
</div>
</div>
<p></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/javascript string replace all/" rel="tag">javascript string replace all</a> <a href="http://www.bradino.com/search/replaceall/" rel="tag">replaceall</a> <a href="http://www.bradino.com/search/replace all/" rel="tag">replace all</a> <a href="http://www.bradino.com/search/string/" rel="tag">string</a> <a href="http://www.bradino.com/search/replace/" rel="tag">replace</a> <a href="http://www.bradino.com/search/javascript/" rel="tag">javascript</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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All&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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;t=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;h=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%20String%20Replace%20All&amp;url=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fstring-replace%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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%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%2Fstring-replace%2F&amp;t=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=The%20JavaScript%20function%20for%20String%20Replace%20replaces%20the%20first%20occurrence%20in%20the%20string.%20The%20function%20is%20similar%20to%20the%20php%20function%20str_replace%20and%20takes%20two%20simple%20parameters.%20The%20first%20parameter%20is%20the%20pattern%20to%20find%20and%20the%20second%20parameter%20is%20th" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;t=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;title=JavaScript%20String%20Replace%20All" 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%2Fstring-replace%2F&amp;submitHeadline=JavaScript%20String%20Replace%20All&amp;submitSummary=The%20JavaScript%20function%20for%20String%20Replace%20replaces%20the%20first%20occurrence%20in%20the%20string.%20The%20function%20is%20similar%20to%20the%20php%20function%20str_replace%20and%20takes%20two%20simple%20parameters.%20The%20first%20parameter%20is%20the%20pattern%20to%20find%20and%20the%20second%20parameter%20is%20th&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%20String%20Replace%20All&amp;body=http%3A%2F%2Fwww.bradino.com%2Fjavascript%2Fstring-replace%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/string-replace/feed/</wfw:commentRss>
		<slash:comments>116</slash:comments>
		</item>
		<item>
		<title>PHP dba_handlers function</title>
		<link>http://www.bradino.com/php-functions/dba_handlers/</link>
		<comments>http://www.bradino.com/php-functions/dba_handlers/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 05:16:17 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[dba_handlers    (PHP 4 &#62;= 4.3.0, PHP 5)dba_handlers -- List all the handlers availableDescriptionarray dba_handlers ( [bool full_info] )&#13;   dba_handlers() list all the handlers supported by this
   extension.
  Parameters&#13;   full_info&#13;       Turns on/off full information display in the result. The default [...]]]></description>
			<content:encoded><![CDATA[<p>dba_handlers<P>    (PHP 4 &#62;= 4.3.0, PHP 5)</P>dba_handlers -- List all the handlers availableDescriptionarray dba_handlers ( [bool full_info] )<BR></BR><P>&#13;   dba_handlers() list all the handlers supported by this<br />
   extension.<br />
  </P>Parameters<P>&#13;   <P></P>full_info<P>&#13;       Turns on/off full information display in the result. The default is<br />
       FALSE.<br />
      </P><br />
  </P>Return Values<P>&#13;   Returns an array of database handlers. If full_info<br />
   is set to TRUE, the array will be associative with the handlers names as<br />
   keys, and their version information as value. Otherwise, the result will be<br />
   an indexed array of handlers names.<br />
  </P><P>Note:<br />
    When the internal cdb library is used you will see<br />
    cdb and cdb_make.<br />
   </P>Examples<P>&#13;   <P>Example 1. dba_handlers() Example</P></p>
<div class="syntax_hilite">
<div id="php-20">
<div class="php"><a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Available DBA handlers:<span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
<span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.bradino.com/php-functions/dba_handlers/"><span style="color:#000066;">dba_handlers</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$handler_name</span> =&amp;gt; <span style="color:#0000FF;">$handler_version</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; <span style="color:#FF9933; font-style:italic;">// clean the versions</span><br />
&nbsp; <span style="color:#0000FF;">$handler_version</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:#0000FF;">$handler_version</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; <a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">" - $handler_name: $handler_version<span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</div>
</div>
<p></p>
<p><P>The above example will output<br />
something similar to:</P>Available DBA handlers:<br />
 - cdb: 0.75, Revision: 1.3.2.3<br />
 - cdb_make: 0.75, Revision: 1.2.2.4<br />
 - db2: Sleepycat Software: Berkeley DB 2.7.7: (08/20/99)<br />
 - inifile: 1.0, Revision: 1.6.2.3<br />
 - flatfile: 1.0, Revision: 1.5.2.4<br />
  </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/dba_handlers/" rel="tag">dba_handlers</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/dba_handlers function/" rel="tag">dba_handlers function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP dba_handlers function/" rel="tag">PHP dba_handlers 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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;t=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;h=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%20dba_handlers%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fdba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%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%2Fdba_handlers%2F&amp;t=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=dba_handlers%20%20%20%20%28PHP%204%20%26%2362%3B%3D%204.3.0%2C%20PHP%205%29dba_handlers%20--%20List%20all%20the%20handlers%20availableDescriptionarray%20dba_handlers%20%28%20%5Bbool%20full_info%5D%20%29%26%2313%3B%20%20%20dba_handlers%28%29%20list%20all%20the%20handlers%20supported%20by%20this%0A%20%20%20extension.%0A%20%20Parameters%26%2313%3B%20%20%20full_info%26%2313" 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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;t=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;title=PHP%20dba_handlers%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%2Fdba_handlers%2F&amp;submitHeadline=PHP%20dba_handlers%20function&amp;submitSummary=dba_handlers%20%20%20%20%28PHP%204%20%26%2362%3B%3D%204.3.0%2C%20PHP%205%29dba_handlers%20--%20List%20all%20the%20handlers%20availableDescriptionarray%20dba_handlers%20%28%20%5Bbool%20full_info%5D%20%29%26%2313%3B%20%20%20dba_handlers%28%29%20list%20all%20the%20handlers%20supported%20by%20this%0A%20%20%20extension.%0A%20%20Parameters%26%2313%3B%20%20%20full_info%26%2313&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%20dba_handlers%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fdba_handlers%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/dba_handlers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ereg_replace function</title>
		<link>http://www.bradino.com/php-functions/ereg_replace/</link>
		<comments>http://www.bradino.com/php-functions/ereg_replace/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 05:10:53 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[ereg_replace    (PHP 3, PHP 4, PHP 5)ereg_replace -- Replace regular expressionDescriptionstring ereg_replace ( string pattern, string replacement, string string )&#13;     This function scans string for matches to
     pattern, then replaces the matched text
     with replacement.
    &#13;  [...]]]></description>
			<content:encoded><![CDATA[<p>ereg_replace<P>    (PHP 3, PHP 4, PHP 5)</P>ereg_replace -- Replace regular expressionDescriptionstring ereg_replace ( string pattern, string replacement, string string )<BR></BR><P>&#13;     This function scans string for matches to<br />
     pattern, then replaces the matched text<br />
     with replacement.<br />
    </P><P>&#13;     The modified string is returned. (Which may mean that the<br />
     original string is returned if there are no matches to be<br />
     replaced.)<br />
    </P><P>&#13;     If pattern contains parenthesized<br />
     substrings, replacement may contain<br />
     substrings of the form<br />
     \\digit, which will<br />
     be replaced by the text matching the digit'th parenthesized<br />
     substring; \\0 will produce the entire<br />
     contents of string.  Up to nine substrings may be used.<br />
     Parentheses may be nested, in which case they are counted by the<br />
     opening parenthesis.<br />
    </P><P>&#13;     If no matches are found in string, then<br />
     string will be returned unchanged.<br />
    </P><P>&#13;     For example, the following code snippet prints "This was a test"<br />
     three times:<br />
    </P><P>&#13;     <P>Example 1. ereg_replace() example</P></p>
<div class="syntax_hilite">
<div id="php-24">
<div class="php"><span style="color:#0000FF;">$string</span> = <span style="color:#FF0000;">"This is a test"</span>;<br />
<a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <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;">" is"</span>, <span style="color:#FF0000;">" was"</span>, <span style="color:#0000FF;">$string</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> <a href="http://www.bradino.com/php-functions/ereg_replace/"><span style="color:#000066;">ereg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"( )is"</span>, <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\\</span>1was"</span>, <span style="color:#0000FF;">$string</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> <a href="http://www.bradino.com/php-functions/ereg_replace/"><span style="color:#000066;">ereg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"(( )is)"</span>, <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\\</span>2was"</span>, <span style="color:#0000FF;">$string</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>    </P><P>&#13;     One thing to take note of is that if you use an integer value as<br />
     the replacement parameter, you may not get<br />
     the results you expect. This is because<br />
     ereg_replace() will interpret the number as<br />
     the ordinal value of a character, and apply that. For instance:<br />
    </P><P>&#13;     <P>Example 2. ereg_replace() example</P></p>
<div class="syntax_hilite">
<div id="php-25">
<div class="php"><span style="color:#008000;">/* This will not work as expected. */</span><br />
<span style="color:#0000FF;">$num</span> = <span style="color:#CC66CC;">4</span>;<br />
<span style="color:#0000FF;">$string</span> = <span style="color:#FF0000;">"This string has four words."</span>;<br />
<span style="color:#0000FF;">$string</span> = <a href="http://www.bradino.com/php-functions/ereg_replace/"><span style="color:#000066;">ereg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'four'</span>, <span style="color:#0000FF;">$num</span>, <span style="color:#0000FF;">$string</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;">$string</span>;&nbsp; &nbsp;<span style="color:#008000;">/* Output: 'This string has&nbsp; &nbsp;words.' */</span></p>
<p><span style="color:#008000;">/* This will work. */</span><br />
<span style="color:#0000FF;">$num</span> = <span style="color:#FF0000;">'4'</span>;<br />
<span style="color:#0000FF;">$string</span> = <span style="color:#FF0000;">"This string has four words."</span>;<br />
<span style="color:#0000FF;">$string</span> = <a href="http://www.bradino.com/php-functions/ereg_replace/"><span style="color:#000066;">ereg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'four'</span>, <span style="color:#0000FF;">$num</span>, <span style="color:#0000FF;">$string</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;">$string</span>;&nbsp; &nbsp;<span style="color:#008000;">/* Output: 'This string has 4 words.' */</span></div>
</div>
</div>
<p></p>
<p>    </P><P>&#13;     <P>Example 3. Replace URLs with links</P></p>
<div class="syntax_hilite">
<div id="php-26">
<div class="php"><span style="color:#0000FF;">$text</span> = <a href="http://www.bradino.com/php-functions/ereg_replace/"><span style="color:#000066;">ereg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"[[:alpha:]]+://[^&amp;lt;&amp;gt;[:space:]]+[[:alnum:]/]"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#FF0000;">"&amp;lt;a href=<span style="color:#000099; font-weight:bold;">\"</span><span style="color:#000099; font-weight:bold;">\\</span>0<span style="color:#000099; font-weight:bold;">\"</span>&amp;gt;<span style="color:#000099; font-weight:bold;">\\</span>0&amp;lt;/a&amp;gt;"</span>, <span style="color:#0000FF;">$text</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>    </P><P>Tip:<br />
      preg_replace(), which uses a Perl-compatible<br />
      regular expression syntax, is often a faster alternative to<br />
      ereg_replace().<br />
     </P><P>&#13;     See also ereg(), eregi(),<br />
     eregi_replace(), str_replace(), and<br />
     preg_match().<br />
    </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/ereg_replace/" rel="tag">ereg_replace</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/ereg_replace function/" rel="tag">ereg_replace function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP ereg_replace function/" rel="tag">PHP ereg_replace 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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;t=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;h=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%20ereg_replace%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%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%2Fereg_replace%2F&amp;t=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=ereg_replace%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29ereg_replace%20--%20Replace%20regular%20expressionDescriptionstring%20ereg_replace%20%28%20string%20pattern%2C%20string%20replacement%2C%20string%20string%20%29%26%2313%3B%20%20%20%20%20This%20function%20scans%20string%20for%20matches%20to%0A%20%20%20%20%20pattern%2C%20then%20replaces%20the%20mat" 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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;t=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;title=PHP%20ereg_replace%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%2Fereg_replace%2F&amp;submitHeadline=PHP%20ereg_replace%20function&amp;submitSummary=ereg_replace%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29ereg_replace%20--%20Replace%20regular%20expressionDescriptionstring%20ereg_replace%20%28%20string%20pattern%2C%20string%20replacement%2C%20string%20string%20%29%26%2313%3B%20%20%20%20%20This%20function%20scans%20string%20for%20matches%20to%0A%20%20%20%20%20pattern%2C%20then%20replaces%20the%20mat&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%20ereg_replace%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fereg_replace%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/ereg_replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP mail function</title>
		<link>http://www.bradino.com/php-functions/mail/</link>
		<comments>http://www.bradino.com/php-functions/mail/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 04:53:34 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[mail    (PHP 3, PHP 4, PHP 5)mail -- Send mailDescriptionbool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )&#13;   Sends an email.
  Parameters&#13;   to&#13;       Receiver, or receivers of the mail.
      [...]]]></description>
			<content:encoded><![CDATA[<p>mail<P>    (PHP 3, PHP 4, PHP 5)</P>mail -- Send mailDescriptionbool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )<BR></BR><P>&#13;   Sends an email.<br />
  </P>Parameters<P>&#13;   <P></P>to<P>&#13;       Receiver, or receivers of the mail.<br />
      </P><P>&#13;       The formatting of this string must comply with<br />
       RFC 2822. Some examples are:<br />
       <P></P>user@example.comuser@example.com, anotheruser@example.comUser &#60;user@example.com&#62;User &#60;user@example.com&#62;, Another User &#60;anotheruser@example.com&#62;<P></P><br />
      </P>subject<P>&#13;       Subject of the email to be sent.<br />
      </P><P></P>Caution<P>&#13;        This must not contain any newline characters, or the mail may not be<br />
        sent properly.<br />
       </P>message<P>&#13;       Message to be sent.<br />
      </P><P>&#13;       Each line should be separated with a LF (\n). Lines should not be larger<br />
       than 70 characters.<br />
      </P><P></P>Caution<P>&#13;        (Windows only) When PHP is talking to a SMTP server directly, if a full<br />
        stop is found on the start of a line, it is removed. To counter-act this,<br />
        replace these occurrences with a double dot.</p>
<div class="syntax_hilite">
<div id="php-32">
<div class="php"><span style="color:#0000FF;">$text</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 style="color:#000099; font-weight:bold;">\n</span>."</span>, <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>.."</span>, <span style="color:#0000FF;">$text</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>       </P>additional_headers (optional)<P>&#13;       String to be inserted at the end of the email header.<br />
      </P><P>&#13;       This is typically used to add extra headers (From, Cc, and Bcc).<br />
       Multiple extra headers should be separated with a CRLF (\r\n).<br />
      </P><P>Note:<br />
        When sending mail, the mail must contain<br />
        a From header. This can be set with the<br />
        additional_headers parameter, or a default<br />
        can be set in php.ini.<br />
       </P><P>&#13;        Failing to do this will result in an error<br />
        message similar to Warning: mail(): "sendmail_from" not<br />
        set in php.ini or custom "From:" header missing.<br />
        The From header sets also<br />
        Return-Path under Windows.<br />
       </P><P>Note:<br />
        If messages are not received, try using a LF (\n) only.<br />
        Some poor quality Unix mail transfer agents replace LF by CRLF<br />
        automatically (which leads to doubling CR if CRLF is used).<br />
        This should be a last resort, as it does not comply with<br />
        RFC 2822.<br />
       </P>additional_parameters (optional)<P>&#13;       The additional_parameters parameter<br />
       can be used to pass an additional parameter to the program configured<br />
       to use when sending mail using the sendmail_path<br />
       configuration setting. For example, this can be used to set the<br />
       envelope sender address when using sendmail with the<br />
       -f sendmail option.<br />
      </P><P>&#13;       The user that the webserver runs as should be added as a trusted user to the<br />
       sendmail configuration to prevent a 'X-Warning' header from being added<br />
       to the message when the envelope sender (-f) is set using this method.<br />
       For sendmail users, this file is /etc/mail/trusted-users.<br />
      </P><br />
  </P>Return Values<P>&#13;   Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.<br />
  </P><P>&#13;   It is important to note that just because the mail was accepted for delivery,<br />
   it does NOT mean the mail will actually reach the intended destination.<br />
  </P>ChangeLog<P>&#13;   <P></P>VersionDescription4.3.0 (Windows only)&#13;        All custom headers (like From, Cc, Bcc and Date) are supported, and are<br />
        not case-sensitive.<br />
        (As custom headers are not interpreted by the MTA in the first place,<br />
        but are parsed by PHP, PHP &#60; 4.3 only supported the Cc header element<br />
        and was case-sensitive).<br />
       4.2.3&#13;        The additional_parameters parameter is disabled in<br />
        safe_mode and the<br />
        mail() function will expose a warning message<br />
        and return FALSE when used.<br />
       4.0.5&#13;        The additional_parameters parameter was added.<br />
       <P></P><br />
  </P>Examples<P>&#13;   <P>Example 1. Sending mail.</P><P>&#13;     Using mail() to send a simple email:<br />
    </P></p>
<div class="syntax_hilite">
<div id="php-33">
<div class="php"><span style="color:#FF9933; font-style:italic;">// The message</span><br />
<span style="color:#0000FF;">$message</span> = <span style="color:#FF0000;">"Line 1<span style="color:#000099; font-weight:bold;">\n</span>Line 2<span style="color:#000099; font-weight:bold;">\n</span>Line 3"</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// In case any of our lines are larger than 70 characters, we should use wordwrap()</span><br />
<span style="color:#0000FF;">$message</span> = <a href="http://www.bradino.com/php-functions/wordwrap/"><span style="color:#000066;">wordwrap</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$message</span>, <span style="color:#CC66CC;">70</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// Send</span><br />
<a href="http://www.bradino.com/php-functions/mail/"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'caffinated@example.com'</span>, <span style="color:#FF0000;">'My Subject'</span>, <span style="color:#0000FF;">$message</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>   <P>Example 2. Sending mail with extra headers.</P><P>&#13;     The addition of basic headers, telling the MUA<br />
     the From and Reply-To addresses:<br />
    </P></p>
<div class="syntax_hilite">
<div id="php-34">
<div class="php"><span style="color:#0000FF;">$to</span>&nbsp; &nbsp; &nbsp; = <span style="color:#FF0000;">'nobody@example.com'</span>;<br />
<span style="color:#0000FF;">$subject</span> = <span style="color:#FF0000;">'the subject'</span>;<br />
<span style="color:#0000FF;">$message</span> = <span style="color:#FF0000;">'hello'</span>;<br />
<span style="color:#0000FF;">$headers</span> = <span style="color:#FF0000;">'From: webmaster@example.com'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> .<br />
&nbsp; &nbsp; <span style="color:#FF0000;">'Reply-To: webmaster@example.com'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> .<br />
&nbsp; &nbsp; <span style="color:#FF0000;">'X-Mailer: PHP/'</span> . <a href="http://www.bradino.com/php-functions/phpversion/"><span style="color:#000066;">phpversion</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</p>
<p><a href="http://www.bradino.com/php-functions/mail/"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to</span>, <span style="color:#0000FF;">$subject</span>, <span style="color:#0000FF;">$message</span>, <span style="color:#0000FF;">$headers</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>   <P>Example 3. Sending mail with an additional command line parameter.</P><P>&#13;     The additional_parameters parameter<br />
     can be used to pass an additional parameter to the program configured<br />
     to use when sending mail using the sendmail_path.<br />
    </P></p>
<div class="syntax_hilite">
<div id="php-35">
<div class="php"><a href="http://www.bradino.com/php-functions/mail/"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'nobody@example.com'</span>, <span style="color:#FF0000;">'the subject'</span>, <span style="color:#FF0000;">'the message'</span>, <span style="color:#000000; font-weight:bold;">null</span>,<br />
&nbsp; &nbsp;<span style="color:#FF0000;">'-fwebmaster@example.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>   <P>Example 4. Sending HTML email</P><P>&#13;     It is also possible to send HTML email with mail().<br />
    </P></p>
<div class="syntax_hilite">
<div id="php-36">
<div class="php"><span style="color:#FF9933; font-style:italic;">// multiple recipients</span><br />
<span style="color:#0000FF;">$to</span>&nbsp; = <span style="color:#FF0000;">'aidan@example.com'</span> . <span style="color:#FF0000;">', '</span>; <span style="color:#FF9933; font-style:italic;">// note the comma</span><br />
<span style="color:#0000FF;">$to</span> .= <span style="color:#FF0000;">'wez@example.com'</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// subject</span><br />
<span style="color:#0000FF;">$subject</span> = <span style="color:#FF0000;">'Birthday Reminders for August'</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// message</span><br />
<span style="color:#0000FF;">$message</span> = <span style="color:#FF0000;">'<br />
&amp;lt;html&amp;gt;<br />
&amp;lt;head&amp;gt;<br />
&nbsp; &amp;lt;title&amp;gt;Birthday Reminders for August&amp;lt;/title&amp;gt;<br />
&amp;lt;/head&amp;gt;<br />
&amp;lt;body&amp;gt;<br />
&nbsp; &amp;lt;p&amp;gt;Here are the birthdays upcoming in August!&amp;lt;/p&amp;gt;<br />
&nbsp; &amp;lt;table&amp;gt;<br />
&nbsp; &nbsp; &amp;lt;tr&amp;gt;<br />
&nbsp; &nbsp; &nbsp; &amp;lt;th&amp;gt;Person&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Day&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Month&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Year&amp;lt;/th&amp;gt;<br />
&nbsp; &nbsp; &amp;lt;/tr&amp;gt;<br />
&nbsp; &nbsp; &amp;lt;tr&amp;gt;<br />
&nbsp; &nbsp; &nbsp; &amp;lt;td&amp;gt;Joe&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;3rd&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;August&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;1970&amp;lt;/td&amp;gt;<br />
&nbsp; &nbsp; &amp;lt;/tr&amp;gt;<br />
&nbsp; &nbsp; &amp;lt;tr&amp;gt;<br />
&nbsp; &nbsp; &nbsp; &amp;lt;td&amp;gt;Sally&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;17th&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;August&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;1973&amp;lt;/td&amp;gt;<br />
&nbsp; &nbsp; &amp;lt;/tr&amp;gt;<br />
&nbsp; &amp;lt;/table&amp;gt;<br />
&amp;lt;/body&amp;gt;<br />
&amp;lt;/html&amp;gt;<br />
'</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// To send HTML mail, the Content-type header must be set</span><br />
<span style="color:#0000FF;">$headers</span>&nbsp; = <span style="color:#FF0000;">'MIME-Version: 1.0'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
<span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">'Content-type: text/html; charset=iso-8859-1'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// Additional headers</span><br />
<span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">'To: Mary &amp;lt;mary@example.com&amp;gt;, Kelly &amp;lt;kelly@example.com&amp;gt;'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
<span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">'From: Birthday Reminder &amp;lt;birthday@example.com&amp;gt;'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
<span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">'Cc: birthdayarchive@example.com'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;<br />
<span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">'Bcc: birthdaycheck@example.com'</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\r</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</p>
<p><span style="color:#FF9933; font-style:italic;">// Mail it</span><br />
<a href="http://www.bradino.com/php-functions/mail/"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to</span>, <span style="color:#0000FF;">$subject</span>, <span style="color:#0000FF;">$message</span>, <span style="color:#0000FF;">$headers</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p><P>&#13;     <P>Note:<br />
       If intending to send HTML or otherwise Complex mails, it is recommended<br />
       to use the PEAR package PEAR::Mail_Mime.<br />
      </P><br />
    </P><br />
  </P>Notes<P>Note:<br />
    The Windows implementation of mail() differs in many<br />
    ways from the Unix implementation. First, it doesn't use a local binary<br />
    for composing messages but only operates on direct sockets which means a<br />
    MTA is needed listening on a network socket (which<br />
    can either on the localhost or a remote machine).<br />
   </P><P>&#13;    Second, the custom headers like<br />
    From:,<br />
    Cc:,<br />
    Bcc: and<br />
    Date: are<br />
    not interpreted by the<br />
    MTA in the first place, but are parsed by PHP.<br />
   </P><P>&#13;    As such, the to parameter should not be an address<br />
    in the form of "Something &#60;someone@example.com&#62;". The<br />
    mail command may not parse this properly while talking with<br />
    the MTA.<br />
   </P><P>Note:<br />
    Email with attachments and special<br />
    types of content (e.g. HTML) can be sent using this function. This is<br />
    accomplished via MIME-encoding - for more information, see this<br />
    &#13;    Zend article or the &#13;    PEAR Mime Classes.<br />
   </P><P>Note:<br />
    It is worth noting that the mail() function is not<br />
    suitable for larger volumes of email in a loop. This function opens<br />
    and closes an SMTP socket for each email, which is not very efficient.<br />
   </P><P>&#13;    For the sending of large amounts of email, see the<br />
    PEAR::Mail, and<br />
    PEAR::Mail_Queue packages.<br />
   </P><P>Note:<br />
    The following RFCs may be useful:<br />
    RFC 1896,<br />
    RFC 2045,<br />
    RFC 2046,<br />
    RFC 2047,<br />
    RFC 2048,<br />
    RFC 2049, and<br />
    RFC 2822.<br />
   </P>See Also<P>&#13;   <P></P>imap_mail()PEAR::MailPEAR::Mail_Mime<P></P><br />
  </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/mail/" rel="tag">mail</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/mail function/" rel="tag">mail function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP mail function/" rel="tag">PHP mail 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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;t=PHP%20mail%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%2Fmail%2F&amp;h=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%20mail%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fmail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%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%2Fmail%2F&amp;t=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=mail%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29mail%20--%20Send%20mailDescriptionbool%20mail%20%28%20string%20to%2C%20string%20subject%2C%20string%20message%20%5B%2C%20string%20additional_headers%20%5B%2C%20string%20additional_parameters%5D%5D%20%29%26%2313%3B%20%20%20Sends%20an%20email.%0A%20%20Parameters%26%2313%3B%20%20%20to%26%2313%3B%20%20%20%20%20%20%20Receiver%2C%20or%20rece" 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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;t=PHP%20mail%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%2Fmail%2F&amp;title=PHP%20mail%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%2Fmail%2F&amp;submitHeadline=PHP%20mail%20function&amp;submitSummary=mail%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29mail%20--%20Send%20mailDescriptionbool%20mail%20%28%20string%20to%2C%20string%20subject%2C%20string%20message%20%5B%2C%20string%20additional_headers%20%5B%2C%20string%20additional_parameters%5D%5D%20%29%26%2313%3B%20%20%20Sends%20an%20email.%0A%20%20Parameters%26%2313%3B%20%20%20to%26%2313%3B%20%20%20%20%20%20%20Receiver%2C%20or%20rece&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%20mail%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fmail%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/mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP nl2br function</title>
		<link>http://www.bradino.com/php-functions/nl2br/</link>
		<comments>http://www.bradino.com/php-functions/nl2br/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 04:40:00 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[nl2br    (PHP 3, PHP 4, PHP 5)nl2br --
     Inserts HTML line breaks before all newlines in a string
    Descriptionstring nl2br ( string string )&#13;     Returns string with '&#60;br /&#62;' inserted
     before all newlines.
    Note:
 [...]]]></description>
			<content:encoded><![CDATA[<p>nl2br<P>    (PHP 3, PHP 4, PHP 5)</P>nl2br --<br />
     Inserts HTML line breaks before all newlines in a string<br />
    Descriptionstring nl2br ( string string )<BR></BR><P>&#13;     Returns string with '&#60;br /&#62;' inserted<br />
     before all newlines.<br />
    </P><P>Note:<br />
     Starting with PHP 4.0.5, nl2br() is now XHTML<br />
     compliant.  All versions before 4.0.5 will return<br />
     string with '&#60;br&#62;' inserted before<br />
     newlines instead of '&#60;br /&#62;'.<br />
    </P><P>&#13;     <P>Example 1. using nl2br()</P></p>
<div class="syntax_hilite">
<div id="php-38">
<div class="php"><a href="http://www.bradino.com/php-functions/echo/"><span style="color:#000066;">echo</span></a> <a href="http://www.bradino.com/php-functions/nl2br/"><span style="color:#000066;">nl2br</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"foo isn't<span style="color:#000099; font-weight:bold;">\n</span> bar"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p><P>&#13;       this will output :<br />
      </P>foo isn't&#60;br /&#62;<br />
 bar<br />
    </P><P>&#13;     See also htmlspecialchars(),<br />
     htmlentities(),<br />
     wordwrap(), and<br />
     str_replace().<br />
    </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/nl2br/" rel="tag">nl2br</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/nl2br function/" rel="tag">nl2br function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP nl2br function/" rel="tag">PHP nl2br 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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;t=PHP%20nl2br%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%2Fnl2br%2F&amp;h=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%20nl2br%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fnl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%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%2Fnl2br%2F&amp;t=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=nl2br%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29nl2br%20--%20%0A%20%20%20%20%20Inserts%20HTML%20line%20breaks%20before%20all%20newlines%20in%20a%20string%0A%20%20%20%20Descriptionstring%20nl2br%20%28%20string%20string%20%29%26%2313%3B%20%20%20%20%20Returns%20string%20with%20%27%26%2360%3Bbr%20%2F%26%2362%3B%27%20inserted%0A%20%20%20%20%20before%20all%20newlines.%0A%20%20%20%20Note%3A%20%0A%20%20%20%20%20Start" 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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;t=PHP%20nl2br%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%2Fnl2br%2F&amp;title=PHP%20nl2br%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%2Fnl2br%2F&amp;submitHeadline=PHP%20nl2br%20function&amp;submitSummary=nl2br%20%20%20%20%28PHP%203%2C%20PHP%204%2C%20PHP%205%29nl2br%20--%20%0A%20%20%20%20%20Inserts%20HTML%20line%20breaks%20before%20all%20newlines%20in%20a%20string%0A%20%20%20%20Descriptionstring%20nl2br%20%28%20string%20string%20%29%26%2313%3B%20%20%20%20%20Returns%20string%20with%20%27%26%2360%3Bbr%20%2F%26%2362%3B%27%20inserted%0A%20%20%20%20%20before%20all%20newlines.%0A%20%20%20%20Note%3A%20%0A%20%20%20%20%20Start&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%20nl2br%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fnl2br%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/nl2br/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ob_start function</title>
		<link>http://www.bradino.com/php-functions/ob_start/</link>
		<comments>http://www.bradino.com/php-functions/ob_start/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 04:39:26 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[ob_start    (PHP 4, PHP 5)ob_start -- Turn on output bufferingDescriptionbool ob_start ( [callback output_callback [, int chunk_size [, bool erase]]] )&#13;     This function will turn output buffering on. While output
     buffering is active no output is sent from the script (other than
   [...]]]></description>
			<content:encoded><![CDATA[<p>ob_start<P>    (PHP 4, PHP 5)</P>ob_start -- Turn on output bufferingDescriptionbool ob_start ( [callback output_callback [, int chunk_size [, bool erase]]] )<BR></BR><P>&#13;     This function will turn output buffering on. While output<br />
     buffering is active no output is sent from the script (other than<br />
     headers), instead the output is stored in an internal buffer.<br />
    </P><P>&#13;     The contents of this internal buffer may be copied into a string<br />
     variable using ob_get_contents().  To output<br />
     what is stored in the internal buffer, use<br />
     ob_end_flush().  Alternatively,<br />
     ob_end_clean() will silently discard the<br />
     buffer contents.<br />
    </P><P>&#13;     An optional output_callback function may<br />
     be specified. This function takes a string as a parameter and<br />
     should return a string. The function will be called when<br />
     ob_end_flush() is called, or when the output<br />
     buffer is flushed to the browser at the end of the request.  When<br />
     output_callback is called, it will receive<br />
     the contents of the output buffer as its parameter and is<br />
     expected to return a new output buffer as a result, which will be<br />
     sent to the browser. If the output_callback is not<br />
     a callable function, this function will return FALSE.<br />
     If the callback function has two parameters, the second parameter is filled<br />
     with a bit-field consisting of<br />
     PHP_OUTPUT_HANDLER_START,<br />
     PHP_OUTPUT_HANDLER_CONT and<br />
     PHP_OUTPUT_HANDLER_END.<br />
     If output_callback returns FALSE original input<br />
     is sent to the browser.<br />
    </P><P>Note:<br />
      In PHP 4.0.4, ob_gzhandler() was introduced<br />
      to facilitate sending gz-encoded data to web browsers that<br />
      support compressed web pages.  ob_gzhandler()<br />
      determines what type of content encoding the browser will accept<br />
      and will return its output accordingly.<br />
     </P><P>Note:<br />
      Before PHP 4.3.2 this function did not return FALSE in case the passed<br />
      output_callback can not be executed.<br />
     </P><P></P>Warning<P>&#13;      Some web servers (e.g. Apache) change the working directory of a script<br />
      when calling the callback function. You can change it back by e.g.<br />
      chdir(dirname($_SERVER['SCRIPT_FILENAME'])) in the<br />
      callback function.<br />
     </P><P>&#13;     If the optional parameter chunk_size is passed, the<br />
     callback function is called on every first newline after<br />
     chunk_size bytes of output.<br />
     The output_callback parameter may be bypassed by<br />
     passing a NULL value.<br />
    </P><P>&#13;     If the optional parameter erase is set to FALSE,<br />
     the buffer will not be deleted until the script finishes (as of PHP 4.3.0).<br />
    </P><P>&#13;     Output buffers are stackable, that is, you may call<br />
     ob_start() while another<br />
     ob_start() is active. Just make<br />
     sure that you call ob_end_flush()<br />
     the appropriate number of times. If multiple output callback<br />
     functions are active, output is being filtered sequentially<br />
     through each of them in nesting order.<br />
    </P><P>&#13;     ob_end_clean(),<br />
     ob_end_flush(), ob_clean(),<br />
     ob_flush() and ob_start()<br />
     may not be called from a callback function. If you call them from<br />
     callback function, the behavior is undefined. If you would like to<br />
     delete the contents of a buffer, return "" (a null string) from callback<br />
     function.<br />
     You can't even call functions using the output buffering functions like<br />
     print_r($expression, true) or<br />
     highlight_file($filename, true) from a callback<br />
     function.<br />
    </P><P>&#13;     <P>Example 1. User defined callback function example</P></p>
<div class="syntax_hilite">
<div id="php-41">
<div class="php"><span style="color:#000000; font-weight:bold;">function</span> callback<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$buffer</span><span style="color:#006600; font-weight:bold;">&#41;</span> <br />
<span style="color:#006600; font-weight:bold;">&#123;</span><br />
&nbsp; <span style="color:#FF9933; font-style:italic;">// replace all the apples with oranges</span><br />
&nbsp; <span style="color:#616100;">return</span> <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;">"apples"</span>, <span style="color:#FF0000;">"oranges"</span>, <span style="color:#0000FF;">$buffer</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<span style="color:#006600; font-weight:bold;">&#125;</span></p>
<p><a href="http://www.bradino.com/php-functions/ob_start/"><span style="color:#000066;">ob_start</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"callback"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p>
&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;p&gt;It's like comparing apples to oranges.&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<div class="syntax_hilite">
<div id="php-42">
<div class="php"><a href="http://www.bradino.com/php-functions/ob_end_flush/"><span style="color:#000066;">ob_end_flush</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p><P>&#13;       Would produce:<br />
      </P>&#60;html&#62;<br />
&#60;body&#62;<br />
&#60;p&#62;It's like comparing oranges to oranges.&#60;/p&#62;<br />
&#60;/body&#62;<br />
&#60;/html&#62;<br />
    </P><P>&#13;     See also ob_get_contents(),<br />
     ob_end_flush(),<br />
     ob_end_clean(),<br />
     ob_implicit_flush(),<br />
     ob_gzhandler(), ob_iconv_handler()<br />
     mb_output_handler(), and<br />
     ob_tidyhandler().<br />
    </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/ob_start/" rel="tag">ob_start</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/ob_start function/" rel="tag">ob_start function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP ob_start function/" rel="tag">PHP ob_start 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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;t=PHP%20ob_start%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%2Fob_start%2F&amp;h=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%20ob_start%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%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%2Fob_start%2F&amp;t=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=ob_start%20%20%20%20%28PHP%204%2C%20PHP%205%29ob_start%20--%20Turn%20on%20output%20bufferingDescriptionbool%20ob_start%20%28%20%5Bcallback%20output_callback%20%5B%2C%20int%20chunk_size%20%5B%2C%20bool%20erase%5D%5D%5D%20%29%26%2313%3B%20%20%20%20%20This%20function%20will%20turn%20output%20buffering%20on.%20While%20output%0A%20%20%20%20%20buffering%20is%20active%20no%20out" 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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;t=PHP%20ob_start%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%2Fob_start%2F&amp;title=PHP%20ob_start%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%2Fob_start%2F&amp;submitHeadline=PHP%20ob_start%20function&amp;submitSummary=ob_start%20%20%20%20%28PHP%204%2C%20PHP%205%29ob_start%20--%20Turn%20on%20output%20bufferingDescriptionbool%20ob_start%20%28%20%5Bcallback%20output_callback%20%5B%2C%20int%20chunk_size%20%5B%2C%20bool%20erase%5D%5D%5D%20%29%26%2313%3B%20%20%20%20%20This%20function%20will%20turn%20output%20buffering%20on.%20While%20output%0A%20%20%20%20%20buffering%20is%20active%20no%20out&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%20ob_start%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fob_start%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/ob_start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP str_ireplace function</title>
		<link>http://www.bradino.com/php-functions/str_ireplace/</link>
		<comments>http://www.bradino.com/php-functions/str_ireplace/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 04:17:24 +0000</pubDate>
		<dc:creator>BRADINO</dc:creator>
				<category><![CDATA[PHP Functions]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[str_ireplace    (PHP 5)str_ireplace --
     Case-insensitive version of str_replace().
    Descriptionmixed str_ireplace ( mixed search, mixed replace, mixed subject [, int &#38;count] )&#13;     This function returns a string or an array with all occurrences of
     search in subject
  [...]]]></description>
			<content:encoded><![CDATA[<p>str_ireplace<P>    (PHP 5)</P>str_ireplace --<br />
     Case-insensitive version of str_replace().<br />
    Descriptionmixed str_ireplace ( mixed search, mixed replace, mixed subject [, int &#38;count] )<BR></BR><P>&#13;     This function returns a string or an array with all occurrences of<br />
     search in subject<br />
     (ignoring case) replaced with the given replace<br />
     value.  If you don't need fancy replacing rules, you should generally<br />
     use this function instead of eregi_replace() or<br />
     preg_replace() with the i modifier.<br />
    </P><P>&#13;     If subject is an array, then the search<br />
     and replace is performed with every entry of<br />
     subject, and the return value is an array<br />
     as well.<br />
    </P><P>&#13;     If search and<br />
     replace are arrays, then<br />
     str_ireplace() takes a value from each array<br />
     and uses them to do search and replace on<br />
     subject. If<br />
     replace has fewer values than<br />
     search, then an empty string is used for<br />
     the rest of replacement values. If search<br />
     is an array and replace is a string; then<br />
     this replacement string is used for every value of<br />
     search.<br />
    </P><P>&#13;     <P>Example 1. str_ireplace() example</P></p>
<div class="syntax_hilite">
<div id="php-44">
<div class="php"><span style="color:#0000FF;">$bodytag</span> = str_ireplace<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"%body%"</span>, <span style="color:#FF0000;">"black"</span>, <span style="color:#FF0000;">"&amp;lt;body text=%BODY%&amp;gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>    </P><P>&#13;     This function is binary safe.<br />
    </P><P>Note:<br />
      As of PHP 5.0.0 the number of matched and replaced<br />
      needles will be returned in<br />
      count which is passed by reference.<br />
      Prior to PHP 5.0.0 this parameter is not available.<br />
     </P><P>&#13;     See also:<br />
     str_replace(),<br />
     preg_replace(), and<br />
     strtr().<br />
    </P></p>
<div class="awmp_tags"><a href="http://www.bradino.com/search/str_ireplace/" rel="tag">str_ireplace</a> <a href="http://www.bradino.com/search/PHP/" rel="tag">PHP</a> <a href="http://www.bradino.com/search/str_ireplace function/" rel="tag">str_ireplace function</a> <a href="http://www.bradino.com/search/php functions/" rel="tag">php functions</a> <a href="http://www.bradino.com/search/PHP str_ireplace function/" rel="tag">PHP str_ireplace 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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;t=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;h=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%20str_ireplace%20function&amp;url=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fstr_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%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%2Fstr_ireplace%2F&amp;t=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%20function&amp;source=BRADINO+LAMP+Development+Tutorials%2C+Code%2C+Tips+%26amp%3B+Tricks&amp;summary=str_ireplace%20%20%20%20%28PHP%205%29str_ireplace%20--%20%0A%20%20%20%20%20Case-insensitive%20version%20of%20str_replace%28%29.%0A%20%20%20%20Descriptionmixed%20str_ireplace%20%28%20mixed%20search%2C%20mixed%20replace%2C%20mixed%20subject%20%5B%2C%20int%20%26%2338%3Bcount%5D%20%29%26%2313%3B%20%20%20%20%20This%20function%20returns%20a%20string%20or%20an%20array%20with%20all%20o" 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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;t=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;title=PHP%20str_ireplace%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%2Fstr_ireplace%2F&amp;submitHeadline=PHP%20str_ireplace%20function&amp;submitSummary=str_ireplace%20%20%20%20%28PHP%205%29str_ireplace%20--%20%0A%20%20%20%20%20Case-insensitive%20version%20of%20str_replace%28%29.%0A%20%20%20%20Descriptionmixed%20str_ireplace%20%28%20mixed%20search%2C%20mixed%20replace%2C%20mixed%20subject%20%5B%2C%20int%20%26%2338%3Bcount%5D%20%29%26%2313%3B%20%20%20%20%20This%20function%20returns%20a%20string%20or%20an%20array%20with%20all%20o&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%20str_ireplace%20function&amp;body=http%3A%2F%2Fwww.bradino.com%2Fphp-functions%2Fstr_ireplace%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/str_ireplace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
