Adding two array – different array

Hi, we have a array , and other array. We want to combine it, for example array(1,2,3,4) – the other array array(a,b,c,d). we want that 1 show -> a , 2 ->b etc…

Look! we can combine it !


< ?php

  $array1=array(1,4,5,6);
  $array2=array(A,K,M,P);
  $array3= array_combine($array1,$array2); 

//array3 will be
 $array3=
   array(
     [1]=>A,
     [4]=>K,
     [5]=>M,
     [6]=>P,
   )

?>

Tags: , , , ,

Reply

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

*

Şu HTML etiketlerini ve özelliklerini kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>