How to handle JSON generated js-sortable?

Sort the blocks by the plugin js-sortable. After dragging - formed array of type ["Stepan", "Olya", "Vladimir", "Alina"]
Now I guess they want to process, each agisce have to assign something like weight. And to pass to the handler somehow so probably
$.get('saveSortable.php', {here will probably be handled json - how to write don't know} );
But how this is done correctly, how to handle and pass this array to write to base weights according to the aydishnik each block?
July 9th 19 at 14:01
1 answer
July 9th 19 at 14:03
Solution
In saveSortable.php something like:
$i = 0;
foreach ($_GET['array'] as $name) {
 $db->query(" UPDATE `table` SET `sort` = ?i WHERE `name` = '?s' ", $i, $name);
$i++;
}

Find more questions by tags jQueryJSONMySQLPHP