Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In each iteration of the loop, you modify <code>$file13</code>, but your loop is only looking at <code>$fileNameNS</code>, which never changes! Since it never changes, if the loop condition is initially true, it will always be true, and never exit.</p> <p>Perhaps you meant this:</p> <pre><code>$fileNameNS = $i . $i . $fileNameNS; </code></pre> <hr> <p>Your condition is mixed up as well, in two ways.</p> <ol> <li>You're continuing while the length is greater than the intended length, when you should be continuing while the length is less than the intended length.</li> <li>You're applying <code>strlen</code> to the comparison <code>$fileNameNS &gt; 15</code>, when you should be applying the comparison to the value of <code>strlen($fileNameNS)</code>.</li> </ol> <pre><code>while(strlen($fileNameNS) &lt; 15) { </code></pre> <hr> <p>Note that because you're adding two copies of <code>$i</code> at a time your final length may be 15 or 16. If this isn't what you want, you should be this instead:</p> <pre><code>$fileNameNS = $i . $fileNameNS; </code></pre> <hr> <p>You incrementing <code>$i</code> with <code>$i++</code> after the loop is finished, so inside the loop the value of <code>$i</code> will never change. If you mean to increment <code>$i</code> each iteration, so that different digits are prepended each time, you need to move that up one line, inside the loop. However if you do this then <code>$i</code> could end up being longer than one digit, again raising the possibility of the final length being 16.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload