title: How to divide an array which has array[0] in 4 values in PHP
body: <p>All values are inserted in arr_type_and_value[0]. </p>
  
  <p>I would like to insert each value in as: </p>
  
  <pre><code>arr_type_and_value[0] &gt;&gt; 1 value,arr_type_and_value[1]&gt;&gt; 2 value,  arr_type_and_value[2] &gt;&gt; 3 value and arr_type_and_value[3] &gt;&gt; 4 value. 
  </code></pre>
  
  <p>How do I do do that?</p>
  
  <pre><code>&lt;?
  $value="1,2,3,4";   
  $arrlst =array();                      
  $arrlst =explode(",",$value);  
  
  foreach($arrlst as $relatedlst) {
  
      $arr_type_and_value=explode(":",$relatedlst);
      print_r($arr_type_and_value); // this got &gt;&gt; Array ( [0] =&gt; 1 ) Array ( [0] =&gt; 2 ) Array ( [0] =&gt; 3 ) Array ( [0] =&gt; 4 ); 
  
      $type= $arr_type_and_value [0]; 
      $value=$arr_type_and_value [1]; 
  
  }        
  ?&gt;
  </code></pre>