title: De-duplication of values of a multidimensional array
body: <p>I need to remove duplicate values from an array.</p>
  
  <p><code>$original_array</code></p>
  
  <pre><code>Array
  (
      [0] =&gt; 1 500 2 4 100 51 52
      [1] =&gt; 515 5 500
      [2] =&gt; 31 351 5 51 61 71 81 91
      [3] =&gt; 1 57 101
      [4] =&gt; 191 25 101 102
  )
  </code></pre>
  
  <p>I thought I’d then be able to explode them by space to create a multidimensional array, and then use <code>array_unique()</code> but that’s not working.</p>
  
  <pre><code># Create new array
  $new_array = array();
  
  # Loop through original_array
  foreach($original_array as $original_array_value)
  {
      $new_array[] = explode(' ', $original_array_value);
  }
  print_r($new_array);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [0] =&gt; 1
              [1] =&gt; 500
              [2] =&gt; 2
              [3] =&gt; 4
              [4] =&gt; 100
              [5] =&gt; 51
              [6] =&gt; 52
          )
  
      [1] =&gt; Array
          (
              [0] =&gt; 515
              [1] =&gt; 5
              [2] =&gt; 500
          )
  
      [2] =&gt; Array
          (
              [0] =&gt; 31
              [1] =&gt; 351
              [2] =&gt; 5
              [3] =&gt; 51
              [4] =&gt; 61
              [5] =&gt; 71
              [6] =&gt; 81
              [7] =&gt; 91
          )
  
      [3] =&gt; Array
          (
              [0] =&gt; 1
              [1] =&gt; 57
              [2] =&gt; 101
          )
  
      [4] =&gt; Array
          (
              [0] =&gt; 191
              [1] =&gt; 25
              [2] =&gt; 101
              [3] =&gt; 102
          )
  
  )
  </code></pre>
  
  <p>The final array result doesn't really matter to me as long as there are no duplicate values.</p>