Link to home
Start Free TrialLog in
Avatar of Khocviem
Khocviem

asked on

Increase varialbe of php in javascript ?

please help me solve  this problem

<?php
    $i=0;
  ?>
  <script language="javascript" type="text/javascript">
        for(var a=0;a<5;a++)
        {
              <?php $i++; ?>
              document.write("<?php echo $i; ?>");  
        }
  </script>
  <?php  
?>

result : 11111

How can I get the result "12345" ? Thank you
ASKER CERTIFIED SOLUTION
Avatar of KennyTM
KennyTM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial