<?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 &#8211; Delete selected items from an array</title>
	<atom:link href="http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/</link>
	<description>The biggest and the best in the Northwest</description>
	<lastBuildDate>Wed, 11 Jan 2012 14:27:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: kurosaki</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-5854</link>
		<dc:creator>kurosaki</dc:creator>
		<pubDate>Sat, 05 Mar 2011 19:00:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-5854</guid>
		<description>guys i have also a problem with arrays 
for example my array contains 30 elements and i want to remove the first five regardless of values then
what should i do</description>
		<content:encoded><![CDATA[<p>guys i have also a problem with arrays<br />
for example my array contains 30 elements and i want to remove the first five regardless of values then<br />
what should i do</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luca from Italy</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-5196</link>
		<dc:creator>Luca from Italy</dc:creator>
		<pubDate>Thu, 13 Jan 2011 00:59:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-5196</guid>
		<description>Thank you very much, array_filter is amazing and I didn&#039;t know it!!! :-)</description>
		<content:encoded><![CDATA[<p>Thank you very much, array_filter is amazing and I didn&#8217;t know it!!! <img src='http://blog.joshschumacher.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shaffy</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-3194</link>
		<dc:creator>shaffy</dc:creator>
		<pubDate>Sat, 31 Jul 2010 11:22:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-3194</guid>
		<description>Thanks for Tips</description>
		<content:encoded><![CDATA[<p>Thanks for Tips</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: web development</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-3087</link>
		<dc:creator>web development</dc:creator>
		<pubDate>Wed, 23 Jun 2010 08:49:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-3087</guid>
		<description>very helpful post! thanks!</description>
		<content:encoded><![CDATA[<p>very helpful post! thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Althauser</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-2151</link>
		<dc:creator>Ben Althauser</dc:creator>
		<pubDate>Wed, 16 Sep 2009 17:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-2151</guid>
		<description>with an edit from the php array_dif example, here&#039;s a nice comparison and removal script,

 &quot;green&quot;, &quot;red&quot;, &quot;blue&quot;, &quot;red&quot;, &quot;purple&quot;);
$array2 = array(&quot;b&quot; =&gt; &quot;green&quot;, &quot;yellow&quot;, &quot;red&quot;);
$result = array_diff($array1, $array2);
$myray[] = implode(&quot;,&quot;,$result);
echo implode(&quot;,&quot;,$myray);
?&gt;</description>
		<content:encoded><![CDATA[<p>with an edit from the php array_dif example, here&#8217;s a nice comparison and removal script,</p>
<p> &#8220;green&#8221;, &#8220;red&#8221;, &#8220;blue&#8221;, &#8220;red&#8221;, &#8220;purple&#8221;);<br />
$array2 = array(&#8220;b&#8221; =&gt; &#8220;green&#8221;, &#8220;yellow&#8221;, &#8220;red&#8221;);<br />
$result = array_diff($array1, $array2);<br />
$myray[] = implode(&#8220;,&#8221;,$result);<br />
echo implode(&#8220;,&#8221;,$myray);<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-1891</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 28 Aug 2009 16:02:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-1891</guid>
		<description>I have used unset() on an array element to remove the element.

I like your solution!</description>
		<content:encoded><![CDATA[<p>I have used unset() on an array element to remove the element.</p>
<p>I like your solution!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cool</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-1855</link>
		<dc:creator>Cool</dc:creator>
		<pubDate>Thu, 30 Jul 2009 16:40:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-1855</guid>
		<description>That&#039;s very helpfu.
Thanks for the tips.</description>
		<content:encoded><![CDATA[<p>That&#8217;s very helpfu.<br />
Thanks for the tips.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Schumacher</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-1852</link>
		<dc:creator>Josh Schumacher</dc:creator>
		<pubDate>Mon, 27 Jul 2009 17:22:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-1852</guid>
		<description>@Cool, yes you can use a combo of array_filter with another helper to remove any elements with the letter &#039;c&#039; from you array above.  Here&#039;s some sample code for your use case:

$array = array(&#039;abc&#039;,&#039;cde&#039;,&#039;efg&#039;);

function hasNoC($val) {
     return (stripos($val, &#039;c&#039;) === false);
}

$clean_array = array_filter($array, &quot;hasNoC&quot;);</description>
		<content:encoded><![CDATA[<p>@Cool, yes you can use a combo of array_filter with another helper to remove any elements with the letter &#8216;c&#8217; from you array above.  Here&#8217;s some sample code for your use case:</p>
<p>$array = array(&#8216;abc&#8217;,'cde&#8217;,'efg&#8217;);</p>
<p>function hasNoC($val) {<br />
     return (stripos($val, &#8216;c&#8217;) === false);<br />
}</p>
<p>$clean_array = array_filter($array, &#8220;hasNoC&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cool</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-1851</link>
		<dc:creator>Cool</dc:creator>
		<pubDate>Mon, 27 Jul 2009 17:05:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-1851</guid>
		<description>For example,

$array = array(abc,cde, efg);

If i want to remove elements that match with character &#039;c&#039; from an array like above,

can it be works by using array_filter() and preg_match()?

Coz from wat i see here is using function within it to remove the elements. so i need to put whole command  in current function, right?

Please correct me if i&#039;m wrong.</description>
		<content:encoded><![CDATA[<p>For example,</p>
<p>$array = array(abc,cde, efg);</p>
<p>If i want to remove elements that match with character &#8216;c&#8217; from an array like above,</p>
<p>can it be works by using array_filter() and preg_match()?</p>
<p>Coz from wat i see here is using function within it to remove the elements. so i need to put whole command  in current function, right?</p>
<p>Please correct me if i&#8217;m wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaveh Rassoulzadegan</title>
		<link>http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/comment-page-1/#comment-1741</link>
		<dc:creator>Kaveh Rassoulzadegan</dc:creator>
		<pubDate>Mon, 20 Apr 2009 16:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joshschumacher.com/2007/03/22/php-delete-selected-items-from-an-array/#comment-1741</guid>
		<description>You may change your discussion title. It is too global.

Maybe with something like :

&quot;Delete selected items from an array with conditions&quot;

for people looking for unset or array_splice.</description>
		<content:encoded><![CDATA[<p>You may change your discussion title. It is too global.</p>
<p>Maybe with something like :</p>
<p>&#8220;Delete selected items from an array with conditions&#8221;</p>
<p>for people looking for unset or array_splice.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

