Hi,
i have this form for create dropdown from array
Now I would like to begin with an array like this and enter into the Option Value the price as VALUE using this array:
I tried, but I have not gotten results.
thenks a lot
Cornelio
i have this form for create dropdown from array
<?php
/* Array Contents */
$array_p = array('product1','product2','product3','product4','product5');
echo '<select name="product[]" multiple>';
for ($i = 0; $i < count($array_p); $i++)
{
echo '<option value="' . ($i + 1) . '">' . $array_p[$i] . '</option>';
}
echo'</select>';
?>
Now I would like to begin with an array like this and enter into the Option Value the price as VALUE using this array:
$array_p = array([{"price1":"10","name":"product1"},
{"price2":"25","name":"product2"},
{"price3":"25","name":"product3"},
{"price4":"25","name":"product4"},
{"price5":"15","name":"product5"}]);
I tried, but I have not gotten results.
thenks a lot
Cornelio