I'm having a tags group from where we can select different number of tags. Currently, these tags are being displayed in order in which they are input. I want these to be displayed in an alphabetical order.
Here is the php code for the part (ta_name is what I want this to sort to):
<div class="control-group">
<label class="control-label" for="qu_tags[]"><?php echo lang("input_tags"); ?></label>
<div class="controls">
<select id="qu_tags" name="qu_tags[]" size="10" multiple="multiple">
<option value="">- Choose Tags</option>
<?php foreach ($tags as $ta) { ?>
<option value="<?php echo $ta["_taid"]; ?>" <?php echo set_select('qu_tags[]', $ta["_taid"]); ?>><?php echo $ta["ta_name"]; ?></option>
<?php } ?>
</select>
<span class="help-inline error"><?php echo form_error("qu_tags[]"); ?></span>
</div>
</div>
Can you please help me in here to display them in an alphabetical order regardless of the way they are input.