title: get the last common array value in PHP dynamically
body: <p>I have original array as given below</p>
  
  <pre><code>$orginal_arra = Array(
      [0] =&gt; 53_0.1,
      [1] =&gt; 53_0.3,
      [2] =&gt; 54_0.2,
      [3] =&gt; 54_0.1,    
      [4] =&gt; 54_0.1,
      [5] =&gt; 54_0.19,
      [6] =&gt; 56_0.19,
      [7] =&gt; 56_0.50
  );
  </code></pre>
  
  <p>The above array can explode by "_" separating</p>
  
  <pre><code>foreach($orginal_arra as $part) {
      if($part){
          $arr_parts = explode("_",$part);
          $arr1[] = $arr_parts[0];
          $arr2[] = $arr_parts[1];
      }
  }
  </code></pre>
  
  <p>The $arr1 result after sperating</p>
  
  <pre><code>Array (
      [0] =&gt; 53,
      [1] =&gt; 53,
      [2] =&gt; 54,
      [3] =&gt; 54,
      [4] =&gt; 54,
      [5] =&gt; 54,
      [6] =&gt; 56,
      [7] =&gt; 56
  )
  </code></pre>
  
  <p>The $arr2 result after sperating</p>
  
  <pre><code>Array (
      [0] =&gt; 0.1,
      [1] =&gt; 0.3,
      [2] =&gt; 0.2,
      [3] =&gt; 0.1,
      [4] =&gt; 0.1,
      [5] =&gt; 0.19,
      [6] =&gt; 0.19,
      [7] =&gt; 0.50
  )
  </code></pre>
  
  <p>I want to return the array by combining $arr1 and $arr2 as like</p>
  
  <pre><code>$array = Array(
      [0] =&gt; 53_0.3,
      [1] =&gt; 54_0.19,
      [2] =&gt; 56_0.50
  );
  </code></pre>
  
  <p>Is there any way to get the result like above using PHP Arrays.</p>