Php javascript conflict with passing javascript to php
<p>I have a slight problem.  I have several arrays in php with different team names.  Each array contains teams of a certain league.  When I click an add button I get the option to add a new entry to the calendar.  I want the drop down to have only the teams for that league.  onclick of the add button I call a javascript function that knows what division was clicked.  However in order to give the javascript the information for which teams to display I have to pass it one of the php arrays.  The problem I am having is telling php which array to pass to javascript depending on which league javascript is on.  I don't want to specify the array myself because there is an option to add a league and this would mean having to code in more code each time a league is added.  The point of the site is being dynamic.</p>

<p>here is some code.</p>

<pre><code>for ($i = 0;$i&lt;$sizeof($leaguesarray);$i++){
    $htmlimploded[$i] = implode($html[$i]);
}
</code></pre>

<p>here I have used emplode to make all of my php arrays readable into javascript.</p>

<pre><code>for (var h = 0; h&lt;size; h++){ // goes through every league 
    if(h == leaguenum){ // finds the league for the clicked add button
        // this is the line that I have trouble with I can't think of 
        //anyway of telling it which array to use since it is serverside code.
        var myarray = ["&lt;? echo $htmlimploded[]?&gt;"]; 
    }
}
</code></pre>

<p>Javascript code above.</p>
