How can I pass an array variable containing my images in the form of DataURL to my server?
Example of array
["aug.jpg,data:image\/jpeg;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD\/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDA......]
I have tried to JSON.stringify the value of the array on the front end and attempt to json_decode on the backend but it results in an error :
"error_log() expects parameter 1 to be string, array given"
I have also tried creating a hidden input field for each array of images(dataURL) that I have and serializing the value but when receiving the value of the input on the server, i am unable to convert it back to an array.
for (let k = 0; k < Object.keys(savedImageFilesArray_complex_form).length; k++) {
console.log("Appending image");
var img_item = (savedImageFilesArray_complex_form[k]);
//img_item=JSON.stringify(['testing','testing123']);
var input = document.createElement("input");
input.type = "hidden";
input.name = "finalImageFilesComplexForm"+k+"[]";
input.class = 'serializeImages' +k;
input.value = img_item
appendArea.appendChild(input);
$('.serializeImages'+k).serialize();
}
(Edited with server code)
Appended below is the value that i am receiving on the $request on the server end.

When trying to json_decode the value, it results in the error as mentioned earlier with the parameter 1 being a string rather than an array
error_log(json_decode($request['finalImageFilesComplexForm0'][0]));