mysql - PHP $_POST[][] two dimensional array to json_encode adding extra single quotes

The problem is that I am naming my form elements like the following (Highlighted):

enter image description here

There are the collection of arrays in my form. Now I want to save these arrays in MySql database table which has json dataType (I am using MySQL v-8 with PHPDO). For this purpose I have used the following function to convert my $_POST array to json array:

  $case = json_encode($_POST['case']);

It working fine and saving record in my table's columns but here is the problem that it stores the keys with the following manners:

enter image description here

In the above snapshot you may see that each key has been enclosed by double quotes and then with single quotes.

I need to save the same record with json column but without single quotation after double quotes.

What am I doing wrong? My Php code for the above to convert from $_POST['case'] array to json array is as follow:

    ......
    $case = json_encode($_POST['case']);
    $ret = json_encode($_POST['ret']);
    $discussion = $_POST['discussion'];
    $next_appointment_date = $_POST['next_appointment_date'];
    $remarks = isset($_POST['remarks']) && !empty($_POST['remarks']) ? trim($_POST['remarks']):'';
    $signature = isset($_POST['signature']) && !empty($_POST['signature']) ? trim($_POST['signature']):'';
    //search the same case details before saving...
    $sql_search = "SELECT * FROM case_information 
                   WHERE case_info->>'$.first_party' = :first_party 
                        AND case_info->>'$.second_party' = :second_party 
                        AND case_info->>'$.case_nature' = :case_nature
                        AND case_info->>'$.received_date' = :received_date";
    $parem_search = array(':first_party'=>$_POST['case']["'first_party'"],
                          ':second_party'=>$_POST['case']["'second_party'"],
                          ':case_nature'=>$_POST['case']["'case_nature'"],
                          ':received_date'=>$_POST['case']["'received_date'"]);
        if($db->dbQuery($sql_search,$parem_search)){
            echo('3');
        }else{
            //insert new record
            $sql_insert = "INSERT INTO case_information (
                case_info,
                instituted_by,
                returned_to,
                discussion,
                remarks,
                next_date_apt,
                person_signature,
                entry_made_on
              )
              VALUES
                (
                :case_info,
                :instituted_by,
                :returned_to,
                :discussion,
                :remarks,
                :next_date_apt,
                :person_signature,
                :entry_made_on  
                )";
            $param = array(
                        ':case_info'=>$case,
                        ':instituted_by'=>$ins,
                        ':returned_to'=>$ret,
                        ':discussion'=>$discussion,
                        ':remarks'=>$remarks,
                        ':next_date_apt'=>$next_appointment_date,
                        ':person_signature'=>$signature,
                        ':entry_made_on'=>date('Y-m-d')
                        );
                //echo($sql_insert);
                if($db->dbQuery($sql_insert,$param)){
                        echo('4');
                }else{
                         .
                         .

Answer

Solution:

You don't have to use the single quotes in your HTML form. Just array[fieldname] is enough. Like this:

<input type="text" name="case[first_party]" id="first_party" />

Source