PHP - Array_combine first row missing

71 Views Asked by At

I have a problem with Array_combine function. I want to combine prices to set as products keys. First I get everything as string from html form. and use explode function make it array. this process for both. Here it is a short of code;

    $urunler = $_POST['urunler'];
    $fiyatlar = $_POST['fiyatlar'];
    $products = explode(",", $urunler);
    $prices = explode(",", $fiyatlar);
    $dizi_birlestir = array_combine($prices, $products);

// OUTPUT
   [15] => first,
   [25] => second

// EXPECTED OUTPUT
   [10] => first,
   [15] => second,
   [25] => third
0

There are 0 best solutions below