terminal php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Iain Adams

    terminal php

    Hey I want to be able to show a percentage complete number in a
    terminal, such that when the percentage gets bigger it replaces the old
    value on the terminal screen. At the moment I just echo the value and
    in the terminal window the values appear 1 after the other. i.e
    123456789101112 but i want the new values to replace the old ones. Is
    this possible

  • adlerweb

    #2
    Re: terminal php

    Just echo a \r

    echo "10%";
    echo "\r20%";
    echo "\r100%\n";

    should do the job

    Iain Adams schrieb:
    Hey I want to be able to show a percentage complete number in a
    terminal, such that when the percentage gets bigger it replaces the old
    value on the terminal screen. At the moment I just echo the value and
    in the terminal window the values appear 1 after the other. i.e
    123456789101112 but i want the new values to replace the old ones. Is
    this possible
    >

    Comment

    • Michael

      #3
      Re: terminal php

      This makes me look like a noob but I always wondered what return did.
      :)
      adlerweb wrote:
      Just echo a \r
      >
      echo "10%";
      echo "\r20%";
      echo "\r100%\n";
      >
      should do the job
      >
      Iain Adams schrieb:
      Hey I want to be able to show a percentage complete number in a
      terminal, such that when the percentage gets bigger it replaces the old
      value on the terminal screen. At the moment I just echo the value and
      in the terminal window the values appear 1 after the other. i.e
      123456789101112 but i want the new values to replace the old ones. Is
      this possible

      Comment

      Working...