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