How to sort field_info_instances return value by field weight?
You probably want something like this

$info = field_info_instances('node','bundle_name');

uasort($info, function($a, $b) {
  $a_weight = (is_array($a) &amp;&amp; isset($a['widget']['weight'])) ? $a['widget']['weight'] : 0;
  $b_weight = (is_array($b) &amp;&amp; isset($b['widget']['weight'])) ? $b['widget']['weight'] : 0;

  if ($a_weight == $b_weight) {
    return 0;
  }

  return ($a_weight &lt; $b_weight) ? -1 : 1;
});

// $info is now sorted by weight.