sorting array

sorting array

hey guys Im trying to sort and array by a price ('total_price')

here is what my array looks like...but obviously there are more items

  1. [{"item_id":"1","title":"Test","price":"99","p_and_p":"0","total_price":"99","listing":"","condition":"","start_date_time":"2014-07-26 21:51:45","listing_duration":"10"

here is my script ive started to make


  1. $(document).ready( function ()

    {

    var data = <?php echo $data; ?> ,

    limit = '10' ;


    $.each(data, function ()

    {

    $( "#table" ).append( '<div class="row"><span class="cell">' + this .title + '</span><span class="cell">' + this .price + '</span><span class="cell"></span></div>' );

    });

    });

what I need is to sort the data ascending and descending by total price....any help on how I could do this would be greatly appreciated...thank you