title: PHP CLI :: Clear Screen
body: <p>Too bad to be true... but reality was surprising enough after googling such a simple topic without any proper solution...</p>
  
  <p>Admins please don't mark it as a double because none of the answers here :
  <a href="https://stackoverflow.com/questions/24327544/how-can-clear-screen-in-php-cli-like-cls-command">How can clear screen in php cli (like cls command)</a> was working under Windows platform.</p>
  
  <p>I tried :</p>
  
  <pre><code>system('cls');
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>system('clear'); //Might work under Linux
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>echo chr(27).chr(91).'H'.chr(27).chr(91).'J';
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>ncurses_clear();
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>passthru('clear');
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>passthru('cls');
  </code></pre>
  
  <p>None of them was working for me (...as you  might guess)</p>
  
  <p>I need the cursor to come back to 0,0 position so please don't post any loop of blank strings or "\r\n" to the screen.</p>