<?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: Split() by newline and return using PHP</title>
	<atom:link href="http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Wed, 23 May 2012 11:06:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Archil Imnadze</title>
		<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/comment-page-1/#comment-902</link>
		<dc:creator>Archil Imnadze</dc:creator>
		<pubDate>Wed, 11 Jan 2012 14:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/26/split-by-newline-and-return-using-php/#comment-902</guid>
		<description>When splitting an empty string you don&#039;t get an empty array, instead you get an array with an empty string as it&#039;s only element. To improve Tim&#039;s answer here is a function:

function split_lines ($string) {
    $lines = preg_split(&quot;/\r\n&#124;\r&#124;\n/&quot;, $string);
    if (count($lines) == 1 &amp;&amp; !$lines[0]) {
        return array();
    }
    return $lines;
}</description>
		<content:encoded><![CDATA[<p>When splitting an empty string you don&#8217;t get an empty array, instead you get an array with an empty string as it&#8217;s only element. To improve Tim&#8217;s answer here is a function:</p>
<p>function split_lines ($string) {<br />
    $lines = preg_split(&#8220;/\r\n|\r|\n/&#8221;, $string);<br />
    if (count($lines) == 1 &amp;&amp; !$lines[0]) {<br />
        return array();<br />
    }<br />
    return $lines;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/comment-page-1/#comment-518</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sat, 25 Sep 2010 23:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/26/split-by-newline-and-return-using-php/#comment-518</guid>
		<description>Also, your regexp is total BS. You&#039;re confusing (\r&#124;\n) with [\r\n]. [] doesn&#039;t need &#124;, since it&#039;s for single characters. The 100% sure-fire cross-platform separator is (?:\r\n&#124;\r&#124;\n), which can be abbreviated to (?:\r\n?&#124;\n).</description>
		<content:encoded><![CDATA[<p>Also, your regexp is total BS. You&#8217;re confusing (\r|\n) with [\r\n]. [] doesn&#8217;t need |, since it&#8217;s for single characters. The 100% sure-fire cross-platform separator is (?:\r\n|\r|\n), which can be abbreviated to (?:\r\n?|\n).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pan Panpan</title>
		<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/comment-page-1/#comment-494</link>
		<dc:creator>Pan Panpan</dc:creator>
		<pubDate>Wed, 14 Jul 2010 19:12:21 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/26/split-by-newline-and-return-using-php/#comment-494</guid>
		<description>Sorry, 

php says:

This function [split] has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

Use preg_split instead.

greets.</description>
		<content:encoded><![CDATA[<p>Sorry, </p>
<p>php says:</p>
<p>This function [split] has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.</p>
<p>Use preg_split instead.</p>
<p>greets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pan Panpan</title>
		<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/comment-page-1/#comment-493</link>
		<dc:creator>Pan Panpan</dc:creator>
		<pubDate>Wed, 14 Jul 2010 18:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/26/split-by-newline-and-return-using-php/#comment-493</guid>
		<description>what about

split(&#039;[\r\n&#124;\r&#124;\n]&#039;,$array)

?

Anyway, thanks for your help! I really appreciate.</description>
		<content:encoded><![CDATA[<p>what about</p>
<p>split(&#8216;[\r\n|\r|\n]&#8216;,$array)</p>
<p>?</p>
<p>Anyway, thanks for your help! I really appreciate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fred</title>
		<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/comment-page-1/#comment-492</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Wed, 14 Jul 2010 14:38:54 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/26/split-by-newline-and-return-using-php/#comment-492</guid>
		<description>split (&quot;[\r\n&#124;\n]&quot;, $array); is the solution!</description>
		<content:encoded><![CDATA[<p>split (&#8220;[\r\n|\n]&#8220;, $array); is the solution!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: decko</title>
		<link>http://newsourcemedia.com/blog/split-by-newline-and-return-using-php/comment-page-1/#comment-132</link>
		<dc:creator>decko</dc:creator>
		<pubDate>Sat, 14 Feb 2009 20:49:19 +0000</pubDate>
		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/03/26/split-by-newline-and-return-using-php/#comment-132</guid>
		<description>I think it&#039;s enough using split(&quot;[\n]&quot;,$names);</description>
		<content:encoded><![CDATA[<p>I think it&#039;s enough using split(&quot;[\n]&quot;,$names);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
