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

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -