I've got the following $_POST
array after form submission and executing following line of code:
print_r($_POST); die;//Code to print the $_POST array
//Following is the output of above statement
Array
(
[fileName] => Array
(
[0] => 8.png
[1] => 2_OnClick_OK.jpg
)
[fileLink] => Array
(
[0] => https://www.filepicker.io/api/file/zZ993JyCT9KafUtXAzYd
[1] => https://www.filepicker.io/api/file/1w3cKCW1TMmytb7md3XQ
)
[Submit] => Submit File
)
But actually I want a new array titled $request_arr
which after executing print_r($request_arr); die;
command should look like as follows:
Array
(
[8.png] => Array
(
[0] => https://www.filepicker.io/api/file/zZ993JyCT9KafUtXAzYd
)
[2_OnClick_OK.jpg]
(
[0] => https://www.filepicker.io/api/file/1w3cKCW1TMmytb7md3XQ
)
)
N.B.:- For demonstration purpose only I've taken two elements. In actual scenario there could be hundreds of such elements. So please consider an optimum and efficient way to get this output array.
Thanks in advance.
If you have any query regarding the issue I'm facing please do let me know.