i have a text file named "vars.txt" that holds an array. How can i pull that information and put it in a javascript array? right now i have
<script type="text/javascript">
function test() {
var testvar = <?php file_get_contents('vars.txt') ?>;
alert ("success");
alert (testvar);
};
</script>
and that is not working. is there a better way to pull this data into an array?