[%", ">", $pId); $max = (int)$pCount; for ($i=1; $i<=$max; $i++) { $nId = $pId."_".$i; $nName = "tree".$nId; echo "{ id:'".$nId."', name:'".$nName."'}"; if ($i<$max) { echo ","; } } ?>]