I\'m trying to prepend an item to the beginning of an associative array. I figured the best way to do this is to use array_merge, but I\'m having some odd consequences. I
array_merge will recalculate numeric indexes. Because your associative array iuses numeric indexes they will get renumbered. You either insert a non-numeric charadter in front of the indices like:
$products = array ('_1' => 'Product 1', '_42' => 'Product 42', '_100' => 'Product 100');
Or you can create the resulting array manually:
$newproducts = array (0 => "Select a product");
foreach ($products as $key => $value)
$newproducts[$key] = $value;