<?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; PHP</title>
	<atom:link href="http://www.bradino.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bradino.com</link>
	<description>Just another Wordpress blog</description>
	<lastBuildDate>Wed, 09 Nov 2011 20:09:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>URL Multiple Query Parameters Encoded with HTML Entities</title>
		<link>http://www.bradino.com/php/url-multiple-query-parameters-encoded-with-html-entities/</link>
		<comments>http://www.bradino.com/php/url-multiple-query-parameters-encoded-with-html-entities/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 21:10:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4888</guid>
		<description><![CDATA[I came across a situation where a URL with multiple query parameters was encoded using htmlentities() and PHP was not recognizing the query parameters using $_GET. A common case for encoding urls using htmlentities() is to use them inside XML documents. So a url with multiple query parameters, encoded using htmlentities() would look like this: [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a situation where a URL with multiple query parameters was encoded using htmlentities() and PHP was not recognizing the query parameters using $_GET. A common case for encoding urls using htmlentities() is to use them inside XML documents.</p>
<p>So a url with multiple query parameters, encoded using htmlentities() would look like this:</p>
<p>http://www.bradino.com/?color=white&amp;size=medium&amp;quantity=3</p>
<p>and when that url is accessed the second and third query parameters are not recognized because instead of separating the subsequent variables with an &#038; that character gets converted into &amp;amp;. I could not find a good way to resolve this, so basically I just encoded the query string back to normal using html_entity_decode() and then slammed the parameters back into the $_GET array using parse_str().</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">html_entity_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">parse_str</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">,</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>There must be a better way! Anyone come across this before?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/url-multiple-query-parameters-encoded-with-html-entities/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Screen Scraping Class</title>
		<link>http://www.bradino.com/php/php-screen-scraping-class/</link>
		<comments>http://www.bradino.com/php/php-screen-scraping-class/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 01:04:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Screen Scraping]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4882</guid>
		<description><![CDATA[After some positive feedback I have decided to continue to develop the PHP Screen Scraping class. This post will server as the permanent home for the class. Download PHP Screen Scraping Class Updates 20009-07-30 Added setHeader() function]]></description>
			<content:encoded><![CDATA[<p>After some positive feedback I have decided to continue to develop the PHP Screen Scraping class. This post will server as the permanent home for the class.</p>
<p><a href="http://www.bradino.com/downloads/cScrape.txt" target="blank">Download PHP Screen Scraping Class</a></p>
<p><strong>Updates</strong></p>
<p> 20009-07-30 Added setHeader() function</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/php-screen-scraping-class/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CakePHP Missing Database Table Error</title>
		<link>http://www.bradino.com/php/cakephp-missing-database-table/</link>
		<comments>http://www.bradino.com/php/cakephp-missing-database-table/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 01:07:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4875</guid>
		<description><![CDATA[I am baking a new project management application at work and added a couple new tables to the database today. When I went into the console to bake the new models, they were not in the list&#8230; php /path/cake/console/cake.php bake all -app /path/app/ So I manually typed in the model name and I got a [...]]]></description>
			<content:encoded><![CDATA[<p>I am baking a new project management application at work and added a couple new tables to the database today. When I went into the console to bake the new models, they were not in the list&#8230;</p>
<p><strong>php /path/cake/console/cake.php bake all -app /path/app/</strong></p>
<p>So I manually typed in the model name and I got a missing database table for model error. I checked and double-checked and the database table was named properly. Turns out that some files inside the <strong>/app/tmp/cache/</strong> folder were causing Cake not to recognize that I had added new tables to my database. Once I deleted the cache files cake instantly recognized my new database tables and I was baking away!</p>
<p><strong>rm -Rf /path/app/tmp/cache/cake*</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/cakephp-missing-database-table/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Screen Scraping Twitter</title>
		<link>http://www.bradino.com/php/screen-scraping-twitter/</link>
		<comments>http://www.bradino.com/php/screen-scraping-twitter/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 17:20:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Screen Scraping]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4845</guid>
		<description><![CDATA[I got an email today asking for help to scrape Twitter. In particular, to be able to login. So I am going to show everyone, NOT to encourage anyone to violate Twitters terms of use but as an educational blog post about how PHP and cURL can be used to post variables and store cookies. [...]]]></description>
			<content:encoded><![CDATA[<p>I got an email today asking for help to scrape Twitter. In particular, to be able to login. So I am going to show everyone, NOT to encourage anyone to violate Twitters terms of use but as an educational blog post about how PHP and cURL can be used to post variables and store cookies.</p>
<p>Again, I am using the cScrape class I wrote, which you can <a href="http://www.bradino.com/downloads/cScrape.txt">download</a>. </p>
<p><strong>Step 1</strong><br />
First go to twitter.com and look at the source code of the login to get the form field names and the form post location. You will see that the form posts to https://twitter.com/session and the username and password fields are session[username_or_email] and session[password] respectively.</p>
<p><strong>Step 2</strong><br />
Now you are ready to login. So using the fetch function in the Scrape class you create an associative array to contain the form values you want to post. The other thing you will need to do is uncomment the lines for CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR. Cookies will be required to stay logged in and scrape around. The paths to the cookie files need to be writable by your app. Also you will need to uncomment the line about CURLOPT_FOLLOWLOCATION.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'session[username_or_email]'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;bradino&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'session[password]'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;secret&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$scrape</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'https://twitter.com/sessions'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Step 1.5</strong><br />
Oops that didn&#8217;t work. All I got back was <em>403 Forbidden: The server understood the request, but is refusing to fulfill it</em>. Ahhh I see another variable called authenticity_token I bet Twitter was looking for that. So let&#8217;s back up and first hit twitter.com to get the authenticity_token variable, and then make the login post request with that variable included in our array of parameters.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$scrape</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'https://twitter.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'session[username_or_email]'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;bradino&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'session[password]'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;secret&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'authenticity_token'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$scrape</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchBetween</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name=&quot;authenticity_token&quot; type=&quot;hidden&quot; value=&quot;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$scrape</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$scrape</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'https://twitter.com/sessions'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$scrape</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span><span style="color: #339933;">;</span></pre></div></div>

<p>So that&#8217;s basically it. Now you are logged in and can scrape around and request other pages as you normally would. Sorry it wasn&#8217;t a longer post. I really do enjoy this kind of stuff so if anyone has a request, hit me up.</p>
<p><strong>Errors?</strong><br />
1) Make sure that you are properly parsing the token variable<br />
2) Make sure that you uncommented the lines about CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR, those options need to be enabled and be sure the path set is writable by your application<br />
3) Make sure that the path to the cookie file is writable and that it is getting data written to it<br />
4) If you get a message about being redirected you need to uncomment the line about CURLOPT_FOLLOWLOCATION, that option needs to be enabled true</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/screen-scraping-twitter/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Zipcodes in CSV Generation</title>
		<link>http://www.bradino.com/php/zipcodes-in-csv-generation/</link>
		<comments>http://www.bradino.com/php/zipcodes-in-csv-generation/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 22:30:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4839</guid>
		<description><![CDATA[When exporting to CSV format, then opening in a spreadsheet program like Excel zipcodes that start with a zero or zeroes have the preceding zeros stripped off. Obviously it is because the spreadsheet sees that column as integers and preceding zeros in integers are useless. A quick and dirty trick to force Excel (hopefully you [...]]]></description>
			<content:encoded><![CDATA[<p>When exporting to CSV format, then opening in a spreadsheet program like Excel zipcodes that start with a zero or zeroes have the preceding zeros stripped off. Obviously it is because the spreadsheet sees that column as integers and preceding zeros in integers are useless.</p>
<p>A quick and dirty trick to force Excel (hopefully you are using OpenOffice) to display the full zipcode, we wrap it in double quotes and put an equal sign in front of it, to force it to be a string like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$zipcode</span> <span style="color: #339933;">=</span> <span style="color: #208080;">00123</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$zipcode</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">;</span></pre></div></div>

<p>So if you are doing the straight query to CSV export, using the <b>fputcsv</b> function it would look something like this. Basically just overwrite the value in the row and then continue along.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'zipcode'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'zipcode'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #990000;">fputcsv</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/zipcodes-in-csv-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>admin</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="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> handleSpanishCharacters<span style="color: #009900;">&#40;</span><span style="color: #000088;">$input</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$translate</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Á'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#193;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'É'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#201;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Í'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#205;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Ó'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#211;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Ú'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#218;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Ñ'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#209;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Ü'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#220;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'á'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#225;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'é'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#237;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'í'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#233;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ó'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#243;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ú'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#250;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ñ'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#241;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ü'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#252;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'¿'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#191;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'¡'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#161;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'«'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#171;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'»'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#187;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$translate</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'€'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;#128;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$search</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_keys</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$translate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$replace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$translate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$search</span><span style="color: #339933;">,</span><span style="color: #000088;">$replace</span><span style="color: #339933;">,</span><span style="color: #000088;">$input</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/spanish-character-translation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2147483647</title>
		<link>http://www.bradino.com/php/2147483647/</link>
		<comments>http://www.bradino.com/php/2147483647/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 16:40:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4801</guid>
		<description><![CDATA[I had someone ask me the other day why they were getting 2147483647 as the value for some operation. Any time you see this number, it should be a red flag that you are hitting the ceiling of the values that can be the 4 byte integer. So here in this classic newbie mistake, grooming [...]]]></description>
			<content:encoded><![CDATA[<p>I had someone ask me the other day why they were getting <strong>2147483647</strong> as the value for some operation. Any time you see this number, it should be a red flag that you are hitting the ceiling of the values that can be the 4 byte integer.</p>
<p>So here in this classic newbie mistake, grooming a phone number by casting it to an integer.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$phone</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'6195551234'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$phone</span><span style="color: #339933;">;</span></pre></div></div>

<p>Will result in <strong>2147483647</strong>. </p>
<p>You also see <strong>2147483647</strong> sometimes in database records where the field type is INT and the value you are inserting is greater than 2147483647. Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/2147483647/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Analytics API</title>
		<link>http://www.bradino.com/php/google-analytics-api/</link>
		<comments>http://www.bradino.com/php/google-analytics-api/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 20:43:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4794</guid>
		<description><![CDATA[Unfortunately Google Analytics does not have an API yet&#8230; However I will show you a quick and dirty way to get the data you need. The idea is basically to setup an automated report from within Google Analytics, which will email a CSV file attachment, that you can download and parse with a script. For [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately Google Analytics does not have an API yet&#8230; However I will show you a quick and dirty way to get the data you need. The idea is basically to setup an automated report from within Google Analytics, which will email a CSV file attachment, that you can download and parse with a script. For this example I will use the Zend Mail class because I love Zend Mail and it is free.</p>
<p>So the first step is to schedule the report. For this simple example we will use the default Visitors Report. So login to your Google Analytics account, click Visitors on the main left nav, then click the Email icon up at the top of the report, see screenshot below:</p>
<div id="attachment_4795" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bradino.com/wp-content/uploads/2008/12/ga-screenshot.jpg"><img src="http://www.bradino.com/wp-content/uploads/2008/12/ga-screenshot-300x132.jpg" alt="GA Screenshot" title="ga-screenshot" width="300" height="132" class="size-medium wp-image-4795" /></a><p class="wp-caption-text">Google Analytics  Screenshot</p></div>
<p>Now let&#8217;s get to the code. First step is to connect to your POP mail server and get the new messages. Don&#8217;t forget to download the latest version of Zend at http://framework.zend.com.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zend/Mail/Storage/Pop3.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'host'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;mail.domain.com&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'user'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;info@domain.com&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;secret&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Mail_Storage_Pop3<span style="color: #009900;">&#40;</span><span style="color: #000088;">$params</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$num</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">countMessages</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In a production environment, you would want some logic to verify that the number of messages is greater than 0, loop through the messages, etc but for this tutorial I have omitted these items for brevity. So next we need to download the first message and get its parts.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$parts</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$message</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">countParts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next we spin through the parts, looking for the attachment.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$b</span><span style="color: #339933;">&lt;=</span><span style="color: #000088;">$parts</span><span style="color: #339933;">;</span> <span style="color: #000088;">$b</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$part</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$message</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPart</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$part</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getHeaders</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$headers</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Content-Disposition'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$headers</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'content-disposition'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></pre></div></div>

<p>Then we parse the CSV file to an array for simple looping:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$csv</span> <span style="color: #339933;">=</span> <span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$part</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$lines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$csv</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lines</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The previous code checks the email account, downloads the CSV attachment and parses it to an array. That is all going to stay the same but the matching below will change depending on your needs. For this simplistic example, I am going to get the number of visits from yesterday.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$yesterday</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'F j'</span><span style="color: #339933;">,</span><span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$yesterday</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$visits</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;VISITS: <span style="color: #006699; font-weight: bold;">{$visits}</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So that&#8217;s basically it. Of course in production you would probably want to write the Google Analytics data to a database or whatever, but you get the point! Hopefully Google Analytics will get an API soon, but until then, this works like a champ!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/google-analytics-api/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>FTP Upload File</title>
		<link>http://www.bradino.com/php/ftp-upload-file/</link>
		<comments>http://www.bradino.com/php/ftp-upload-file/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 19:45:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4789</guid>
		<description><![CDATA[Need to transfer files via FTP in some automated or scheduled manner. It is actually quite easy to do using FTP. Following is a simplistic PHP FTP example to get you started. Replace &#8216;hostname&#8217;, &#8216;username&#8217;, and &#8216;password&#8217; with real FTP credentials, then we try and connect to the FTP server. //FTP CONNECT &#160; $connect = [...]]]></description>
			<content:encoded><![CDATA[<p>Need to transfer files via FTP in some automated or scheduled manner. It is actually quite easy to do using FTP. Following is a simplistic PHP FTP example to get you started.</p>
<p>Replace &#8216;hostname&#8217;, &#8216;username&#8217;, and &#8216;password&#8217; with real FTP credentials, then we try and connect to the FTP server.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//FTP CONNECT</span>
&nbsp;
<span style="color: #000088;">$connect</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ftp_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostname'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$login</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ftp_login</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$connect</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'username'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>if an error occurred connecting to the FTP server, then we can stop here:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//CONNECTION ERROR</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$connect</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$login</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;FTP Connection Failed&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Otherwise let&#8217;s proceed and upload a file via FTP. Be sure to replace &#8216;/path/to/file.ext&#8217; with the full path to your file, as well as &#8216;file.ext&#8217; with the filename you would like to use when you FTP up the file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//UPLOAD THE FILE</span>
&nbsp;
<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/path/to/file.ext'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$upload</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ftp_fput</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$connect</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'file.ext'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #339933;">,</span> FTP_ASCII<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">ftp_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$connect</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>and finally let&#8217;s perform a simple check to see if the file was uploaded successfully.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// UPLOAD ERROR</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$upload</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;FTP Upload Failed&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">// UPLOAD SUCCESS</span>
&nbsp;
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;FTP Upload Success&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/php/ftp-upload-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL SELECT WHERE IN</title>
		<link>http://www.bradino.com/mysql/select-where-in/</link>
		<comments>http://www.bradino.com/mysql/select-where-in/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 18:33:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bradino.com/?p=4786</guid>
		<description><![CDATA[Here is a basic sql statement where you are looking for shirts that are red, white or blue. [mysql]SELECT * FROM `shirts` WHERE `color`=&#8217;red&#8217; OR `color`=&#8217;white&#8217; OR `color`=&#8217;blue&#8217;[/mysql] Here is the same request, more efficiently constructed using IN [mysql]SELECT * FROM `shirts` WHERE `color` IN (&#8216;red&#8217;,'white&#8217;,'blue&#8217;)[/mysql] If you are like me and dynamically create SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a basic sql statement where you are looking for shirts that are red, white or blue.</p>
<p>[mysql]SELECT * FROM `shirts` WHERE `color`=&#8217;red&#8217; OR `color`=&#8217;white&#8217; OR `color`=&#8217;blue&#8217;[/mysql]</p>
<p>Here is the same request, more efficiently constructed using IN</p>
<p>[mysql]SELECT * FROM `shirts` WHERE `color` IN (&#8216;red&#8217;,'white&#8217;,'blue&#8217;)[/mysql]</p>
<p>If you are like me and dynamically create SQL statements using PHP then you get the idea of how easy it would be to create this statement. Let&#8217;s say you have an array of possible value.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$colors</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'red'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'white'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'blue'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM `shirts` WHERE `color` IN ('&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;','&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$colors</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;')&quot;</span> <span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bradino.com/mysql/select-where-in/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

