I need to pass a JSON array into a webpage URL so I do
$url = 'page.php?id=' . json_encode($array);
which becames
$url = 'pages.php?id=["1", "2", "3"]';
And then, inside page.php
which is basically Javascript code i do
var foo = <?php $_GET['id']; ?>
But foo
instead of being an array like ["1", "2", "3"]
it's only [
.
Why is this?
Also, is it better to do: url.php?id=value
or url.php?id="value"
??