title: For loop in PHP with a unique output for only one loop
body: <p>I have a project where I have inputs that decide the range of numbers echoed but I also need to have a single number echo more text. At the moment I have an if statement which works but echoes the number a second time.</p>
  
  <pre><code>for ($x = $var1; $x &lt;= $var2; $x += $varInc) {
      echo "&lt;p&gt;$x&lt;/p&gt;";
      if ($x == $varGhost){
          echo "&lt;p class='fas fa-ghost'&gt;&lt;/p&gt;";
      }
  }
  </code></pre>
  
  <p>It's supposed to look similar to this:</p>
  
  <p><a href="https://i.stack.imgur.com/iFZN5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iFZN5.png" alt="enter image description here"></a></p>