<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Remove value from array'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 14 Apr 2026 19:17:28 +0000</lastBuildDate>
    <item>
      <title>svenito said on 30/Sep/2009</title>
      <link>https://snipplr.com/view/20405/remove-value-from-array</link>
      <description>&lt;p&gt;To get around the problem if the last element needs to be removed (issue due to the missing comma at the end) you can use regular expressions:&#13;
&#13;
// make sure to escape $pattern_text as required&#13;
$pattern = "/,*$pattern_text,*/";&#13;
$new_array = explode(',', preg_replace($pattern, '' , (join(',',$array))));&lt;/p&gt;</description>
      <pubDate>Wed, 30 Sep 2009 07:48:42 UTC</pubDate>
      <guid>https://snipplr.com/view/20405/remove-value-from-array</guid>
    </item>
  </channel>
</rss>
