<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PHP Array to String</title>
	<atom:link href="http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/</link>
	<description>web development war stories from the frontlines to the backend</description>
	<lastBuildDate>Fri, 30 Jul 2010 00:38:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: test</title>
		<link>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/comment-page-1/#comment-2737</link>
		<dc:creator>test</dc:creator>
		<pubDate>Wed, 05 Aug 2009 10:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://perplexedlabs.com/2008/02/04/php-array-to-string/#comment-2737</guid>
		<description>test</description>
		<content:encoded><![CDATA[<p>test</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: test</title>
		<link>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/comment-page-1/#comment-2657</link>
		<dc:creator>test</dc:creator>
		<pubDate>Wed, 05 Aug 2009 06:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://perplexedlabs.com/2008/02/04/php-array-to-string/#comment-2657</guid>
		<description>test</description>
		<content:encoded><![CDATA[<p>test</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kersurk</title>
		<link>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/comment-page-1/#comment-2625</link>
		<dc:creator>kersurk</dc:creator>
		<pubDate>Tue, 07 Jul 2009 22:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://perplexedlabs.com/2008/02/04/php-array-to-string/#comment-2625</guid>
		<description>implode should do the trick as well.&lt;br&gt;&lt;br&gt;&lt;code]&gt;function array2str($array, $pre = &#039;&#039;, $pad = &#039;&#039;, $sep = &#039;, &#039;) {&lt;br&gt;	$glue = $pad.$sep.$pre;&lt;br&gt;	return $pre.implode($glue, $array).$pad;&lt;br&gt;}&lt;/code&gt;&lt;br&gt;&lt;br&gt;For multidimensional array, this comment could be useful &lt;a href=&quot;http://ee2.php.net/manual/en/function.implode.php#84644&quot; rel=&quot;nofollow&quot;&gt;http://ee2.php.net/manual/en/function.implode.p...&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>implode should do the trick as well.</p>
<p><code ]>function array2str($array, $pre = &#39;&#39;, $pad = &#39;&#39;, $sep = &#39;, &#39;) {<br />	$glue = $pad.$sep.$pre;<br />	return $pre.implode($glue, $array).$pad;<br />}</code></p>
<p>For multidimensional array, this comment could be useful <a href="http://ee2.php.net/manual/en/function.implode.php#84644" rel="nofollow"></a><a href="http://ee2.php.net/manual/en/function.implode.p.." rel="nofollow">http://ee2.php.net/manual/en/function.implode.p..</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/comment-page-1/#comment-415</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Thu, 18 Dec 2008 16:41:39 +0000</pubDate>
		<guid isPermaLink="false">http://perplexedlabs.com/2008/02/04/php-array-to-string/#comment-415</guid>
		<description>You should add recursive call if $v is an array so your script can handle multi-dimensional arrays. 

Something like:

foreach($array as $v) 
{
	if(is_array($v))
		$str .= array2str($v, $pre, $pad, $sep);
	else
		$str .= $pre.$v.$pad.$sep;  
}</description>
		<content:encoded><![CDATA[<p>You should add recursive call if $v is an array so your script can handle multi-dimensional arrays. </p>
<p>Something like:</p>
<p>foreach($array as $v)<br />
{<br />
	if(is_array($v))<br />
		$str .= array2str($v, $pre, $pad, $sep);<br />
	else<br />
		$str .= $pre.$v.$pad.$sep;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby Array to String&#160;by&#160;Perplexed Labs</title>
		<link>http://blog.perplexedlabs.com/2008/02/04/php-array-to-string/comment-page-1/#comment-2</link>
		<dc:creator>Ruby Array to String&#160;by&#160;Perplexed Labs</dc:creator>
		<pubDate>Tue, 05 Feb 2008 21:53:39 +0000</pubDate>
		<guid isPermaLink="false">http://perplexedlabs.com/2008/02/04/php-array-to-string/#comment-2</guid>
		<description>[...] post below got me thinking about how I would accomplish the same thing in Ruby, turning an array into a [...]</description>
		<content:encoded><![CDATA[<p>[...] post below got me thinking about how I would accomplish the same thing in Ruby, turning an array into a [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
