json_decode a json string sent via cors : I was looking around and tried to decode, but it doesn't seem to work for me.

        //Receive the RAW post responseData.
    $contentJSON = trim(file_get_contents("php://input"));
   
    //Attempt to decode the incoming RAW post responseData from JSON.
    $contentDECODED = json_decode($contentJSON , true);
    $action = mysqli_real_escape_string($connection, $contentDECODED["action"]);
    $customerID = intval(mysqli_real_escape_string($connection, $contentDECODED["customerId"])); 
    $productID_Array = $contentDECODED[gArrayOfProductIds];

`var_dump($productID_Array)` will output:

    array(3) {
          [0]=>
          array(1) {
            ["productId"]=>
            int(52979957765)
          }
          [1]=>
          array(1) {
            ["productId"]=>
            int(69956304901)
          }
          [2]=>
          array(1) {
            ["productId"]=>
            int(69888278533)
          }
        }

but `var_dump(implode(",",array_map('intval',$productID_Array)));` will output:

    "1,1,1"

and `var_dump(implode(",",$productID_Array));` will output:

    "Array,Array,Array"

could someone shred some light on my problem?  
along side that what would be the best way to sanitize the input from the json?


**HUGE thanks for anyone who might help !**