<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Elimate Duplicate Items from a for each </title>
        <link>https://interactivetools.com/forum/forum-posts.php?Elimate-Duplicate-Items-from-a-for-each-79512</link>
        <description></description>
        <pubDate>Mon, 10 Aug 2026 22:09:05 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Elimate-Duplicate-Items-from-a-for-each-79512" rel="self" type="application/rss+xml" />

                <item>
          <title>Elimate Duplicate Items from a for each </title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2233999#post2233999</link>
          <description><![CDATA[<p>Perfect! Thank you so very much. And thank you for the explanation of why it works also.</p>
<p>Josh</p>]]></description>
          <pubDate>Sat, 17 May 2014 05:37:11 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2233999#post2233999</guid>
        </item>
                <item>
          <title>Elimate Duplicate Items from a for each </title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2233989#post2233989</link>
          <description><![CDATA[<p>Hi Josh,</p>
<p>It sounds like you need a way to check what values have already been listed, and ensure that duplicate values are not displayed again. This method should work:</p>
<p><code>&lt;?php $alreadyListed = array();  ?&gt;<br />&lt;?php foreach ($events_listRecords as $record): ?&gt;<br />  &lt;?php if(!in_array(strtolower($record['title']), $alreadyListed)): ?&gt;<br />    &lt;a href="<a href="http://abc.com/title=" rel="nofollow">http://abc.com/title=</a>&lt;?php echo htmlencode($record['title']) ?&gt;"&gt;&lt;?php echo htmlencode($record['title']) ?&gt;&lt;/a&gt;<br />    &lt;?php $alreadyListed[] = strtolower($record['title']); ?&gt;<br />  &lt;?php endif; ?&gt;<br />&lt;?php endforeach; ?&gt;</code></p>
<p>So the $alreadyListed array is created to store titles that have been displayed. When a title is displayed we add its name to the $alreadyListed array. Then an if statement is used to check if a title had already been displayed by looking in the areadyListed array. If it has been displayed already, the item will be skipped. </p>
<p>The strtolower function will ensure that items of a different case will not be displayed twice (eg dog, DoG). But otherwise the titles must match exactly to be skipped.</p>
<p>Thanks!</p>
<p>Greg</p>]]></description>
          <pubDate>Fri, 16 May 2014 14:11:57 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2233989#post2233989</guid>
        </item>
                <item>
          <title>Elimate Duplicate Items from a for each </title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2233986#post2233986</link>
          <description><![CDATA[<p>I'm creating a tag menu based on the titles of a list page. I am struggling with eliminating duplications of the same event title. It seems this should be easy, but the various codes I find around the forums and internet don't seem to work right for this. I've tried a variety of array_unique situations, but can't seem to get it right. Please advise.</p>
<p>&lt;?php foreach ($events_listRecords as $record): ?&gt;<br />  &lt;a href="<a href="http://abc.com/title=" rel="nofollow">http://abc.com/title=</a>&lt;?php echo htmlencode($record['title']) ?&gt;"&gt;&lt;?php echo htmlencode($record['title']) ?&gt;&lt;/a&gt;<br />&lt;?php endforeach; ?&gt;</p>]]></description>
          <pubDate>Fri, 16 May 2014 13:34:21 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2233986#post2233986</guid>
        </item>
              </channel>
    </rss>
  