I'm trying to create a PHP response script that redirects back to a target URL. unfortunately currently when I redirect, the JSON value is not send together. below code is what I've tried.
<?php
header('Location: https://alia.com/readme.html');
$data1 = array('a', 'b', 'c');
header('Content-type: application/json');
echo json_encode($data1);
//prints json array ["a","b","c"]
?>
I wonder how can I create a php response and redirect back to client page.