<?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>Perplexed Labs &#187; array</title>
	<atom:link href="http://blog.perplexedlabs.com/tag/array/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.perplexedlabs.com</link>
	<description>web development war stories from the frontlines to the backend</description>
	<lastBuildDate>Mon, 16 May 2011 14:19:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>PHP Array to String</title>
		<link>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/</link>
		<comments>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 16:52:45 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://perplexedlabs.com/2008/02/04/php-array-to-string/</guid>
		<description><![CDATA[The function below facilitates the process of converting an array to a string. Very useful for building SQL insert queries with arrays of data. &#60;?php function array2str($array, $pre = '', $pad = '', $sep = ', ') { $str = ''; if(is_array($array)) { if(count($array)) { foreach($array as $v) { $str .= $pre.$v.$pad.$sep; } $str = [...]


Related posts:<ol><li><a href='http://blog.perplexedlabs.com/2008/12/17/php-parallel-web-scraper/' rel='bookmark' title='Permanent Link: PHP Parallel Web Scraper'>PHP Parallel Web Scraper</a></li>
<li><a href='http://blog.perplexedlabs.com/2008/02/04/php-simple-profiling-class/' rel='bookmark' title='Permanent Link: PHP Simple Profiling Class'>PHP Simple Profiling Class</a></li>
<li><a href='http://blog.perplexedlabs.com/2009/04/22/php-named-parameters/' rel='bookmark' title='Permanent Link: PHP Named Parameters'>PHP Named Parameters</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The function below facilitates the process of converting an array to a string.  Very useful for building SQL insert queries with arrays of data.</p>
<pre class="brush: php; title: ;">
&lt;?php
function array2str($array, $pre = '', $pad = '', $sep = ', ')
{
	$str = '';
	if(is_array($array)) {
		if(count($array)) {
			foreach($array as $v) {
				$str .= $pre.$v.$pad.$sep;
			}
			$str = substr($str, 0, -strlen($sep));
		}
	} else {
		$str .= $pre.$array.$pad;
	}

	return $str;
}
?&gt;
</pre>


<p>Related posts:<ol><li><a href='http://blog.perplexedlabs.com/2008/12/17/php-parallel-web-scraper/' rel='bookmark' title='Permanent Link: PHP Parallel Web Scraper'>PHP Parallel Web Scraper</a></li>
<li><a href='http://blog.perplexedlabs.com/2008/02/04/php-simple-profiling-class/' rel='bookmark' title='Permanent Link: PHP Simple Profiling Class'>PHP Simple Profiling Class</a></li>
<li><a href='http://blog.perplexedlabs.com/2009/04/22/php-named-parameters/' rel='bookmark' title='Permanent Link: PHP Named Parameters'>PHP Named Parameters</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

