0

Too bad to be true... but reality was surprising enough after googling such a simple topic without any proper solution...

Admins please don't mark it as a double because none of the answers here : How can clear screen in php cli (like cls command) was working under Windows platform.

I tried :

system('cls');

I tried :

system('clear'); //Might work under Linux

I tried :

echo chr(27).chr(91).'H'.chr(27).chr(91).'J';

I tried :

ncurses_clear();

I tried :

passthru('clear');

I tried :

passthru('cls');

None of them was working for me (...as you might guess)

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.

Community
  • 1
  • 1
Hezi-Gangina
  • 637
  • 6
  • 20
  • There cannot be a cross platform way to do this, since there is no cross platform way to clear the screen in different environments you execute some php command in. – arkascha Apr 27 '17 at 17:02
  • I know I post everything so if someone else will google it he might find a solution under my question :D – Hezi-Gangina Apr 27 '17 at 17:04
  • I wrote "there cannot be" - how do you expect anyone to still offer a solution? You have to write a wrapper that detects the environment or use some more intelligent approach, _changing_ the environment, like for example the `screen` utility. – arkascha Apr 27 '17 at 17:05
  • Did you check this one - http://stackoverflow.com/questions/4320081/clear-php-cli-output – Utkarsh Dubey Apr 27 '17 at 17:18

0 Answers0