my variable xt keeps on setting to 20 for all the javascript arrays why is it no
ID: 3645228 • Letter: M
Question
my variable xt keeps on setting to 20 for all the javascript arrays why is it not incrementing after it stores into the array? Please help thanks!PHP/Javascript Code:
<? $xt = 0 ?>;
var j = 0;
while (j < 200) {
<?
while( $xt < 250)
{
if ($members[$xt]['department'] == $depttts){
break;
}
else {
$xt++;
}
}
?>
contacts[j] = {"NAME": "<?
print $xt ?>","TITLE":"number: " + j + " ","CONTACT":"<? print ($members[$xt]['title']).'<br> <b>P: </b>'.($members[$xt]['phone']).'<br> <b>F: </b>'.($members[$xt]['fax']) ?>"}
<? $xt++ ?>;
j++;
}
Explanation / Answer
; var j = 0; while (j < 200) { contacts[j] = {"NAME": "","TITLE":"number: " + j + " ","CONTACT":""} ; j++; }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.