title: combine two serialize data in php
body: <pre><code>$var1='a:1:{i:123;s:3:"123";}';
  
  $var2='a:1:{i:56;s:2:"56";}';
  
  output a:2:{i:56;s:2:"56";i:123;s:3:"123";}
  </code></pre>
  
  <p>Without changing the value of i</p>
  
  <p>Example2;</p>
  
  <pre><code>$var1='a:2:{i:56;s:2:"56";i:123;s:3:"123";}';
  
  $var2='a:1:{i:154;s:3:"154";}';
  
  ouput a:3:{i:56;s:2:"56";i:123;s:3:"123";i:154;s:3:"154";}
  </code></pre>
  
  <p>i am using </p>
  
  <pre><code>$a=unserialize($var1); 
  $a2=unserialize($var2); 
  $result = array_merge($a, $a2); 
  $serialized_array=serialize($result); 
  print_r($serialized_array); 
  </code></pre>
  
  <p>but all the values of i got changed</p>
  
  <p>also what does <code>s</code> stands for in above strings</p>