php - validate directly in your if or create a function? -
the question kinda hard put in words hope make sense
what's best practice?
this
if($value < 5) { //do }
or this
if(validvalue($value)) { //do } function validvalue($value) { if($value < 5) return true; }
this best way validate value rather creating function that's not required.
if ( $value < 5 ) { #do }
Comments
Post a Comment