php combine arrays
$output = array_merge($array1, $array2);
merge two arrays one as key to another php
// two arrays one become keys and second becomes values
array_combine ( array $keys , array $values );
associative array in php have same value join them
<?php
$a = array('green', 'red', 'yellow');
$b = array('avocado', 'apple', 'banana');
$c = array_combine($a, $b);
print_r($c);
?>
array merge with same key in php
Input : $a1=array("a"=>"raj", "b"=>"striver");
$a2=array("z"=>"geeks", "b"=>"articles");
Output :
Array
(
[a] => raj
[b] => Array
(
[0] => striver
[1] => articles
)
[z] => geeks
)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us