I have created a table(test) in database. now i have fetched array in php like this.
$sql="SELECT * FROM test;";
$result=mysqli_query($con,$sql) or die("invalid query ".mysqli_error($con));
while($row=mysqli_fetch_array($result))
{
echo $row['name'];
}
now i want to pass this array into javascript array.
var images=["$row[0]","$row[1]","$row[2]"];// Is that coreect way to pass php array into js array?
if not what is correct way to pass php array to javascript array.