Advertisement
Vladimirgm

Untitled

Jan 25th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2.  
  3.     function merge2arr($arrkey, $arrval)
  4.     {
  5.         /*use the fuction to create a new array using the fist
  6.          for keys and the second  it is values */
  7.         $arrnew = array_combine($arrkey, $arrval);
  8.  
  9.         var_export ($arrnew);
  10.     }
  11.  
  12.     $keys = array('red', 'yellow' , 'blue');
  13.     $values = array('rojo', 'amarillo', 'azul');
  14.  
  15.     // call the function merge2arr
  16.     merge2arr($keys , $values);
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement