Get html data with javascript to php array and store to wordpress database

Here is my own solution.
In my html I’ve assign id to all the item and inside the form I’ve added an input option where I pass the value through the script and it was saved later. Simple…

script

    jQuery(document).ready(function($){
    $(".sortable").sortable({
        connectWith: '.sortable',
        receive: function (event, ui) {
            document.getElementById('hello1').value = myFunction();
        },
        out: function (event, ui) {
            document.getElementById('hello1').value = myFunction();
        }
    });
    function myFunction(){
        var idArray = $("#droppable > p").map(function(){
            return this.id;
        }).get();
        return idArray;
    }
});