Forever Loading


I've got a problem on For Loops in PHP.

When I open this lesson, I get a loading wheel that spins forever—I can't even edit my code. It seems like a bug to me.


The problem might be because of an infinite loop. Sometimes not setting the condition properly inside the for loop results in running the loop infinite times thereby crashing the browser or loading endlessly. Since you haven't pasted your code, here is the solution that I used,

    <link rel="stylesheet" href="stylesheet.css" />
    <title>Codecademy Languages</title>
    <h1>Languages you can learn on Codecademy:</h1>
    <div class="wrapper">
          $langs = array("JavaScript",
          "HTML/CSS", "PHP",
          "Python", "Ruby");
          foreach ($langs as $lang) {
              echo "<li>$lang</li>";

foreach is an enhanced forloop in PHP

hope that helps


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.