array_combine(): keys of one array and values of another

$input1=array('One','Two','Three','Four','Five');
$input2=array(1,2,3,4,5);
$output=array_combine($input1,$input2);
print_r($output);
Output is here
Array ( [One] => 1 [Two] => 2 [Three] => 3 [Four] => 4 [Five] => 5 )
Syntax
array_combine ($input_array1 ,$input_array2 )
ParameterDESCRIPTION
$input_array1Required : Input array of which kyes will be retained.
$input_array2Required : Input array of which values will be retained.
Returns an array with keys of first array and values of second array.

Returns FALSE if both arrays are not having equal number of elements.

Array REFERENCE Getting keys of an array
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here





    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer