PHP Programing language

R4R® PHP
array_combine() Function in PHP
(追記) (追記ここまで)
(追記) (追記ここまで)

array_combine()

The array_combine() function creates an array by using the elements from one "keys" array and one "values" array.

Syntax:
array_combine(keys,values);

In above syntax, "keys" are array of keys and "values" are array of values.

Example:

(追記) (追記ここまで)
<?php
$fruit_name=array("Apple","Banana","Mango");
$fruit_weight=array("5kg","3kg","10kg");
$Total=array_combine($fruit_name,$fruit_weight);
print_r($Total);
?>

Output:

Array ( [Apple] => 5kg [Banana] => 3kg [Mango] => 10kg )

(追記) (追記ここまで)
Copyright ©2021-22 r4r.co.in, all rights reserved. Theguestspost.com
Sitemap
Career
Post comment
About us
Subscription
Unsubscription

AltStyle によって変換されたページ (->オリジナル) /