This question already has an answer here:
I know I am doing this totally wrong and haven't got an idea how to do this.. basically I have a javascript function and trying to use php to declare as array all teams if round equals to 1. The teams and round will come from the parameters in function teamElement()
function teamElement(round, team, isReady) {
<?php if(round == 1) $round2_array[] = team) ?>
document.write('<p>round: ' + round + '<br>team ' + team.name + '<br> is ready ' + isReady);
...
Anyone can help with this please?
many thanks.