javascript variable in quoted php code in javascript

Paphos

New Member
the title sounds weird, but here's my question.I am making this loop in Javascript that needs to call PHP variables. \[code\] var data = http://stackoverflow.com/questions/10544681/new Array("<?php echo count($result) ?>"); for (var i=0; i < "<?php echo count($result) ?>"; i++) { data = "<?php echo $result ?>"; }\[/code\]The third line is the problem.I tried \[code\] data = "<?php echo $result [" + i + " ] ?>";\[/code\]but it didn't work.Any clever tip to solve this??
 
Back
Top