if ( count($panels) > 0): foreach( $panels as $values ): $value = $values->description; $key = $values->id; echo '

'.preg_replace('/([A-Z])/',' $1',$value).'

 
'; if ( is_array($options) ): foreach ( $options as $option ): if ( $key == $option->optionid ): $newarray[$option->sortindex-1] = array('id' => $option->optionid, 'name' => $value); endif; endforeach; else: if ( isset( $options ) ): if ( $key == $options->optionid ): $newarray[$options->sortindex-1] = array('id' => $options->optionid, 'name' => $value); endif; else: $newarray = null; endif; endif; endforeach; endif;