how to encode json.stringified output
<p>i have a form to which the form elements are appended using the onclick event. </p>

<p>the form elements along with their values and label are then maintained in an array . </p>

<pre><code>function save_form() {
    var x = document.getElementById("formBuilder");
    var elements_data = new Array;
    for (var i = 0; i &lt; x.length; i++) {
        if (x.elements[i].type == 'checkbox' || x.elements[i].type == 'radio') {
            var all_ele_value = [];
            var ele_id = x.elements[i].id;
            $("input:" + x.elements[i].type + "[name=" + ele_id + "[]]").each(function () {
                all_ele_value.push($(this).val());
            });
            var end_value = all_ele_value.join(";");
        }
        else if (x.elements[i].type == 'select-one') {
            var ele_id = x.elements[i].id;
            var end_value = $("#" + ele_id + " option").map(function (i, n) {
                return n.value;
            }).get().join(";");
        }
        else {
            var end_value = x.elements[i].value;
        }
    }
    var form_data = JSON.stringify(elements_data);
    $.post(software_url + 'form_manager/save_form', {
        'form_data': form_data
    }, function (data) {
        alert(data);
    });
}
</code></pre>

<p>now i want to encode form_data in my php file . I want to know a way to do that because json_decode does not work. Iam getting all the output in json format .BUt i want to iterate through it.</p>
