Delete screen from terminal with PHP

0

In short, I have this script that I call cls:

#!/usr/bin/env php
<?php
    exec ('clear');

I assign execution permissions like this:

$ chmod +x cls

I execute it in this way from the terminal:

$ cls

Why do not you erase the terminal screen? All the other Linux commands, yes, it executes them.

    
asked by Pedro Ruiz Hidalgo 19.11.2017 в 14:03
source

1 answer

0

The way to erase the screen from a PHP cli is

#!/usr/bin/env php
<?php
    system ('clear');
    
answered by 19.11.2017 / 14:25
source