Php Array To Javascript

Advertisement

The code below has the array $data I would like to pass to js. The code may not be perfect but it is echoing the values.

<?php
$filename = "linksfile.txt";
$page[0] = "index.html";
$page[1] = "about.htm";
$page[2] = "news.htm";
$page[3] = "meminfo.html";
$page[4] = "contact.html";
$page[5] = "golf.htm";
$page[6] = "tennis.htm";
$page[7] = "fanda.htm";
$page[8] = "dining.htm";
$page[9] = "social.htm";
$page[10] = "weddings.htm";
$page[11] = "banquets.htm";
$page[12] = "contact.htm";
$page[13] = "PDFgallery.htm";.....