sorry though, im still noob in this, here is my problem: i get the arrays from links.txt $file = "links.txt"; $lines = file($file); // read file values as array in php PHP: the link.txt : http://blablabla http://somedomain http://anotherdomain Code (markup): i want to display it back for javascript like this : var links = array ( 'http://blablabla', 'http://somedomain', 'http://anotherdomain' //no comma after last link ) Code (markup): i have use var links = Array(<? echo implode("','",$lines) ?>); PHP: but it show like this: var links = array (http://blablabla ','http://somedomain ','http://anotherdomain ) Code (markup): im so desperate ive googleing but still no luck
Try var links = Array(<? echo("'".implode("','",$lines)."'" ?>); PHP: I'm still not sure that will solve your problem, though. *thinking*