When doing this cycle, it prints 0. Why is this?
$ano = '<select>';
for($i=date("Y"); $i>=1900; $i--){
$ano += '<option value="'.$i.'">'.$i.'</option>';
}
$ano +='</select>';
echo $ano;
When doing this cycle, it prints 0. Why is this?
$ano = '<select>';
for($i=date("Y"); $i>=1900; $i--){
$ano += '<option value="'.$i.'">'.$i.'</option>';
}
$ano +='</select>';
echo $ano;
As you have been told, he is used. (point) to concatenate, in fact you do it with $ i.
Only change the + by. (point)
This:
$ano += '<option value="'.$i.'">'.$i.'</option>';
By:
$ano .= '<option value="'.$i.'">'.$i.'</option>';
This:
$ano +='</select>';
By:
$ano .='</select>';