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"'; } 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -