$k = array_search($a,$b); if(empty($k)) { echo '<b>'.$fall.'</b>'; } else { echo '<b>'.$b[$k].'</b>'; }