I need to transfer the values from a PHP array into a JavaScript array so that it can be used in my application, I have managed to get up to this:
var Descriptions = array(<?php
foreach ($tasks as $task) {
$ID = $task['ID'];
$description = $task['description'];
echo $ID . "[" . $description . "]" . ",";
}
?>);
and it works fine except for one thing: I dont know how to tell PHP to not put a comma after the last array value. The extra comma is causing a syntax error so it breaks my code.
Thanks in advance for any ideas, RayQuang