S.Faraji S.Faraji - 3 months ago 6x
HTML Question

How do I populate a combobox from an array in PHP?

I want to have an simple array in php and a combobox in html.

// Here is my array:


Code in php page :

$smarty->assign('cars', $cars);

Smarty code for HTML page(Template page):

<select name="car">
  {foreach from=$cars item=car}
    <option value="{$car}">{$car}</option>