Jump to content

HHHHHHHHEEEEEEEELLLLLLPPPPPP =(


laquitajohnson

Recommended Posts

so, long story short. I am an idiot, I am a student, I decided to take 5 classes and work full time. I need help with  :confused:my PHP and while loops... the book is just confusing me anymore... spring break started today and my teacher isn't responding to my E-mail... also, it's the end of the semester, and I'm not doing too great and if I don't get at least a "D" (haha) in the class, I will loose my Financial Aid... will someone take pity on my soul and please help me.

Link to comment
https://forums.phpfreaks.com/topic/233040-hhhhhhhheeeeeeeellllllpppppp/
Share on other sites

explain what exacly you need to know on while loops ... it's vast ... theres so much ways in using it lol

 

The basic would be

 

while (condition)  {

  code to be executed;

}

 

Ex:

 

<?php
$i=1;
while($i<=5) // Loop 5 times
  {
      echo "The number is " . $i . "<br />";
      $i++; // Will add +1 to the $i var
  }
?>

A while loop is basically just like an if statement.  Only difference is that the while loop repeats itself until the condition it's given is not true.  For example, a while loop that executes if the number 10 is greater than 5, it will keep repeating itself.  That is known as an infinite loop.  A while loop that executes if 5 is greater than 10, it will never execute.  Get the idea?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.