what is the right way to pass the php array to header then post it in another file then pass it using onload event to a javascript file here is my code and it is not working
the code for the first php file
header("location: Rules.php?varFields=".http_build_query($varFields));
the code for the second php file where the php array is passed
$ddd = $_GET['varFields'];
<body onload="cmbRuleField(<?php echo $ddd;?>);" >
the code for the external javascript file
var varDisplay = JSON.stringify(arrayyy);
and also tried this one
var varDisplay = JSON.parse(arrayyy);