0
What if i need to add it to button?
<?php $i = 1; While ($i < 100) { echo " The value is $i <br/>"; $i++; } /*What if I need to add a button and when the button is clicked i need this Loop to Stop Should i write if the button is onclicked in javascript tag $i = false; Is that right? */ ?>
19 Réponses
+ 1
So What The code will be like
+ 2
Get rid of the I++ to make it infinite.
+ 1
No, you should write. (pseudocode)
if button is clicked:
break
The break keyword ends a loop. Hope this helps.
+ 1
No, your loop checks if the value is less than 100, if you set it to false it becomes a boolean, which will not work.
+ 1
Your loop should stop on it's own eventually.
+ 1
Well duh if you remove 100 your loop is no longer valid.
+ 1
$i=1;
while($i < 100){
echo "The value is $i <br/>"
}
+ 1
no remove I++
+ 1
to make it infinite
+ 1
find some sort of time.sleep method for php
0
I didnt Understand Yet
Can Ypu write The code for me?
0
if (issane $The button[ ])) {
$i = false;
}
Is that Work Too?
0
Thats literally Hard How it is possible to stop this wave of words it is so laggy
0
No What if i removed 100 It will not stop
0
How do i need to make it Unstoppable or maybe like it is infinite
0
But you said i need to remobe the 100
0
But you make it until 99 (1<100)
0
Thats so hard
- 1
So slowly it will Loop because when i make it with i++ it goes to 100 quick