Two variables in echo PHP -
i have loop , want show values question$vari2 in loop
$vari1=$_session['quantity']; $vari2=0; while($vari2<$vari1){ $vari2++; extract( $_post, extr_overwrite, "question$vari2" ); echo "<br>data1= ".$_session['data1'.$vari2]; echo "<br>data2= ".$_session['data2'.$vari2]; echo "<br>data3= "."$question1"."<br>"; //problem line }
how write last line show question1, question2 ... in loop try echo '$'.'question'.$vari2;
show $question2 in file not values of variable
you looking variables variable:
$var = "question{$vari2}"; echo "<br>data3={$$var}<br>";
Comments
Post a Comment