I have the following and wondering if there is a shorter way of writing this.
<? if (($querymeminfo['ethnicity'] != NULL) || ($querymeminfo['weight'] != NULL) || ($querymeminfo['height'] != NULL) || ($querymeminfo['waistsize'] != NULL) || ($querymeminfo['bustsize'] != NULL) || ($querymeminfo['tatoos'] != NULL) || ($querymeminfo['bodypiercings'] != NULL) || ($querymeminfo['eyecolor'] != NULL) || ($querymeminfo['haircolor'] != NULL) || ($querymeminfo['available'] != NULL)){ // then do this or define this $show1 = 1; // show this tabs information; } ?>
if they are all the values for $querymeminfo, then you could just foreach() loop through the array. IF they are not the only values you could put the keys in an array and loop through that.
yeah i would do something like:
$attributes = array("haircolor","available","weight"); # etc.. $res = false; foreach($attributes as $attrib){ if($querymeminfo[$attrib]) $res = true; }