title: How to shuffle an array in PHP so that all row are interchanged?
body: <p>I have an array which is having video data ordered in descending order based on video likes. Here is my array:-</p>
  
  <pre><code>Array $video_order_list
  (
      [0] =&gt; Array
          (
              [video_id] =&gt; 1
              [video_title] =&gt; A1
              [video_like] =&gt; 120
          )
  
      [1] =&gt; Array
          (
              [video_id] =&gt; 3
              [video_title] =&gt; A3
              [video_like] =&gt; 73
          )   
  
      [2] =&gt; Array
          (
              [video_id] =&gt; 2
              [video_title] =&gt; A2
              [video_like] =&gt; 63
          )
  
      [3] =&gt; Array
          (
              [video_id] =&gt; 4
              [video_title] =&gt; A4
              [video_like] =&gt; 55
          )
  
      [4] =&gt; Array
          (
              [video_id] =&gt; 5
              [video_title] =&gt; A5
              [video_like] =&gt; 40
          )       
  
      [5] =&gt; Array
          (
              [video_id] =&gt; 6
              [video_title] =&gt; A6
              [video_like] =&gt; 10
          )   
  
      [6] =&gt; Array
          (
              [video_id] =&gt; 7
              [video_title] =&gt; A7
              [video_like] =&gt; 3
          )
  )
  </code></pre>
  
  <p>I am duplicating the array into another array:- </p>
  
  <pre><code>$random_list = $video_order_list;
  </code></pre>
  
  <p>Then I want to shuffle the array, for which I used this:-</p>
  
  <pre><code>shuffle($random_list);
  </code></pre>
  
  <p>However, there is a chance that my shuffled array could be like this:-</p>
  
  <pre><code>Array $random_list
  (
      [0] =&gt; Array
          (
              [video_id] =&gt; 2
              [video_title] =&gt; A2
              [video_like] =&gt; 63
          )
  
      [1] =&gt; Array
          (
              [video_id] =&gt; 3
              [video_title] =&gt; A3
              [video_like] =&gt; 73
          )   
  
      [2] =&gt; Array
          (
              [video_id] =&gt; 7
              [video_title] =&gt; A7
              [video_like] =&gt; 3
          )
  
      [3] =&gt; Array
          (
              [video_id] =&gt; 4
              [video_title] =&gt; A4
              [video_like] =&gt; 55
          )
  
      [4] =&gt; Array
          (
              [video_id] =&gt; 6
              [video_title] =&gt; A6
              [video_like] =&gt; 10
          )
  
      [5] =&gt; Array
          (
              [video_id] =&gt; 5
              [video_title] =&gt; A5
              [video_like] =&gt; 40
          )       
  
      [6] =&gt; Array
          (
              [video_id] =&gt; 1
              [video_title] =&gt; A1
              [video_like] =&gt; 120
          )   
  )
  </code></pre>
  
  <p>See that <code>video_id = 4</code> is still in the 3rd index (4th position). How can I check such problem?</p>