I expected that the number will increase on every alert, but it ended up being the same number which is 0.
Can I know why ?
I need to do this because in my real code, $wow represent the value I retrieved from server and I need to use javascript for loop to count the number element which I targeted.
How can i do this ?
Here is my Code :
<html>
<head>
<script>
<?php $wow = 0; ?>
for(var i =0; i < 4; i++){
alert("<?php echo $wow; ?>");
<?php $wow++; ?>
}
</script>
<body>
</body>
</html>