I have a php associative array $php_array. Also, I have a form like below in my php file.
<form action="" method="post">
<p class="submit">
<input name="submit" class="button-primary" value="Send" type="submit" id="">
<input type="hidden" name="details" value="' . $php_array . '"/>
</p>
</form>
I want to pass this array $php_array to a javascript file like
`details = $("input[name=details]").val();`
The array is in the form
Array(
[59] => Sree
[53] => Smith
)
I want to display the names as drop down using javascript on clicking the link 'send'. how can I pass the php array to javascript