B
butchtroll
Guest
I am using the following to convert a php array to javascript.
var TextsArray = new Array(<?php
foreach($TextsArray as $Text)
{
echo "'$Text',";
}
?>);
The output of this statement is:
var TextsArray = new Array('Your Text Here',);
This generated line creates a syntax error, is it because of the single quotes???
var TextsArray = new Array(<?php
foreach($TextsArray as $Text)
{
echo "'$Text',";
}
?>);
The output of this statement is:
var TextsArray = new Array('Your Text Here',);
This generated line creates a syntax error, is it because of the single quotes???