Simple PHP If Statement Not Acting As Expected -
this simple year validation should check if year between 1900 , current year. if year valid should displayed input's value. if(!empty($year) && $year >= 1900 || !empty($year) && $year <= date('y')){ $yearholder = 'value="'.$year.'"'; }else{ $yearholder = 'placeholder="year"'; } the problem i'm having statement not work, , passes numbers through. you can try this. if(!empty($year) && $year >= 1900 && $year <= date('y')){ $yearholder = 'value="'.$year.'"'; }else{ $yearholder = 'placeholder="year"'; }