Array_combine() –

use of this function you can combine two arrays for creating one array as key and value pare.

Syntax-
array_combine(keys, values)
There is two params, first one is set of keys and second one is values.

Example-
<?php
$keys=array(“1”,“2”,“3”);

$values=array(“one”,“two”,“three”);

$array=array_combine($keys,$values);
print_r($array);
Output//
Array ( [1] => one [2] => two [3] => three )
?>

News Reporter
IT Software and web development, Core PHP, JavaScript, JQuery, HTML, CSS, CakePHP, Angularjs, Codeigniter etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code