<?php
$salaries = array(1000,1500,2000,2500,3000,4000,5000,6000,7000,9000,12000,18000,30000);
$str = '';
foreach($salaries as $salary)
{
$str .= "<option value=\"$salary\">$salary+</option>";
}
function populateSalary()
{
$salaries = array(1000,1500,2000,2500,3000,4000,5000,6000,7000,9000,12000,18000,30000);
$str = '';
foreach($salaries as $salary)
{
$str .= "<option value=\"$salary\">$salary+</option>";
}
return $str;
}
?>
<select id="salaryExpect" name="salaryExpect">
<option value="-1">--<option>
<?php echo populateSalary(); ?>
</select>
Kodunda <option> </option>
olarak böyle boş seçeneği yoktur, ama garip yeterince çıkışı var mı? Bakın.
Can have a look here: http://maishudi.com/test3.php