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

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.

Example 1

$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 )


plus2net.com




Post your comments , suggestion , error , requirements etc here .




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