How to order a list of taxonomy terms alphabetically?

I found an answer to this at https://wordpress.stackexchange.com/a/105079/40536

I modified my code to the following:

<form action="<?php bloginfo('url'); ?>/" method="get">

<?php
$term_id = 279;
$taxonomy_name="categories";
$termchildren = get_term_children( $term_id, $taxonomy_name );
$children = array();
foreach ($termchildren as $child) {
  $term = get_term_by( 'id', $child, $taxonomy_name );
  $children[$term->name] = $term;
}
ksort($children);
echo '<select name="' . $taxonomy_name . '" onchange="this.form.submit()">';
echo '<option selected>Branding...</option>';
foreach ( $children as $child ) {
  $term = get_term_by( 'id', $child->term_id, $taxonomy_name );
  echo '<option value="'. $term->slug .'">' . $term->name . '</a></option>';
}
echo '</select>';
?> 
<noscript><div><input type="submit" value="View" /></div></noscript>

</form>