static function cli_read($format, $first = false)
    {
        $stdin = fopen('php://stdin', 'r');

        $result = fscanf($stdin, $format);

        if ($first) {
            return empty($result[0]) ? '' : $result[0];
        }

        return $result;
    }
static function cli_read($format, $first = false)
    {
        $stdin = fopen('php://stdin', 'r');

        $result = fscanf($stdin, $format);

        if ($first) {
            return empty($result[0]) ? '' : $result[0];
        }

        return $result;
    }
static function cli_read ( $ format , $ first = false ) { $ stdin = fopen ( 'php://stdin' , 'r' ) ; $ result = fscanf ( $ stdin , $ format ) ; if ( $ first ) { return empty ( $ result [ 0 ] ) ? '' : $ result [ 0 ] ; } return $ result ; }
Read a line from cli

@param string $format Line string format
@param boolean $first If true, just return first element, else return result array.

@return string|array
Read a line from cli