i want to call php function inside javascript like this. i want value inside array r can be added to my_func() as parameter. but i get an error when do this.
for(i=0;i<r.length;i++){
var distance = <?php echo my_func(+r[i].coordinate+);?>;
}
or
for(i=0;i<r.length;i++){
var distance = <?php echo my_func(?>r[i].coordinate<?php );?>;
}
If any one have an idea to help I really appreciate it because I need it so much, and thanks to all.