title: How to check duplicates of the TITLE relevant to and ALT_ID of an array
body: <p><strong>This is my array. This array is very big one more than 1000 records. 
  I wrote some code.</strong> </p>
  
  <p>It will work without duplicates only for <code>ALT_ID</code>. <code>TITLE</code> will show with the duplicate.</p>
  
  <p>How to check duplicates of the <code>TITLE</code> relevant to and <code>ALT_ID</code> of an array.</p>
  
  <p>I want to know how to check duplicates of the title relevant to an id of an array.</p>
  
  <pre><code>    Array
  (
      [1] =&gt; Array
          (
              [TITLE] =&gt; Business Management   
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Coursework
              [MARKS] =&gt; 56.00
          )
  
      [2] =&gt; Array
          (
              [TITLE] =&gt; Business Management 
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Exam
              [MARKS] =&gt; 61.00
          )
  
      [3] =&gt; Array
          (
              [TITLE] =&gt; Communication Skills in English
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Exam
              [MARKS] =&gt; 45.00
          )
  
      [4] =&gt; Array
          (
              [TITLE] =&gt; Communication Skills in English
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Course Work 
              [MARKS] =&gt; 57.00
          )
  
      [5] =&gt; Array
          (
              [TITLE] =&gt; Digital Circuits and PC Hardware 
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Exam
              [MARKS] =&gt; 20.00
          )
  
      [6] =&gt; Array
          (
              [TITLE] =&gt; Digital Circuits and PC Hardware 
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Coursework
              [MARKS] =&gt; 67.00
          )
  
      [7] =&gt; Array
          (
              [TITLE] =&gt; Elements of Electronics  
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Exam
              [MARKS] =&gt; 62.00
          )
  
      [8] =&gt; Array
          (
              [TITLE] =&gt; Elements of Electronics  
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Course Work
              [MARKS] =&gt; 79.00
          )
  
      [9] =&gt; Array
          (
              [TITLE] =&gt; Introduction to Databases Systems   
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Coursework
              [MARKS] =&gt; 49.00
          )
  
      [10] =&gt; Array
          (
              [TITLE] =&gt; Introduction to Databases Systems  
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Exam
              [MARKS] =&gt; 34.00
          )
  
      [11] =&gt; Array
          (
              [TITLE] =&gt; Mathematics for Computing &amp; Business     
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Course Work
              [MARKS] =&gt; 82.00
          )
  
      [12] =&gt; Array
          (
              [TITLE] =&gt; Mathematics for Computing &amp; Business    
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Exam
              [MARKS] =&gt; 87.00
          )
  
      [13] =&gt; Array
          (
              [TITLE] =&gt; Personal Computer Based Applications   
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Course Work
              [MARKS] =&gt; 73.00
          )
  
      [14] =&gt; Array
          (
              [TITLE] =&gt; Visual Basic Programming   
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Exam
              [MARKS] =&gt; 56.00
          )
  
      [15] =&gt; Array
          (
              [TITLE] =&gt; Visual Basic Programming   
              [LAST_NAME] =&gt; Stu2455
              [ALT_ID] =&gt; 2003455
              [STUDENT_ID] =&gt; 2492
              [ASSIGNMENT_TITLE] =&gt; Coursework
              [MARKS] =&gt; 62.00
          )
      )
  </code></pre>
  
  <p><strong>Below I wrote PHP Code</strong></p>
  
  <pre><code>    $tmp_results = array();
  foreach($result as $item =&gt; &amp;$rv) {
      if(!isset($tmp_results[$rv['ALT_ID']]))
      {
          $output .= "&lt;tr&gt;&lt;td&gt;" . $rv['ALT_ID'] . "&lt;/td&gt;";
          $tmp_results[$rv['ALT_ID']] = $rv;                                  
      }
  
      if(!isset($tmp_results[$rv['TITLE'] || $rv['ALT_ID']]))
      {
          $output .= "&lt;td&gt;". $rv['TITLE'] ."&lt;/td&gt;&lt;tr&gt;";
          $tmp_results[$rv['TITLE']] = $rv;
      }
  }
  </code></pre>
  
  <p><strong>I want to know how to check duplicates of the title relevant to an id of an array.</strong></p>