Jump to content

array merge help


MDanz

Recommended Posts

i want to preserve the numeric keys.  When i print the array this is the result

 

Array ( [0] => one [1] => two [2] => three ) 

 

it should be

 

Array ( [0] => two [1] => one [2] => three ) 

 

$test1[2] = "one";

$test2[1] = "two";
$test2[3] = "three";

$test = array_merge($test1,$test2);

print_r($test);

 

How do i solve this?

Link to comment
https://forums.phpfreaks.com/topic/247455-array-merge-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.