Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default php and console

    hello all,
    i'm doing a program that run in console (ms-dos prompt), but i have 2 smalls
    problems:

    1) how can i clear the screen? i tryed with system("cls") but doesn't work
    2) how can i colorize the output of echo ?

    thanx all
    Dade


    Dade Guest

  2. Similar Questions and Discussions

    1. Console Isn't Working
      When I put in my information for my server console. Nothing happens. It doesn't do anything. I press login. No response. Nothing. Then if I...
    2. console app w/o seeing console?
      OK, here's a silly question: I want a console application to run totally un-noticed - without the console window popping up. How do I accomplish...
    3. console output ?
      hello group, I've a stupid question concerning console I/O after installation (yes, I've googled this newsgroup, without success). Recently I've...
    4. Logging to /dev/console
      When I am building application and have to log things I do use the echo command to print out whatever I want. I then use the curl command to...
    5. Console redirection SCO
      Lars Oberg wrote: There is no support for writing console messages to dual destinations. You can write them purely to a serial port; see...
  3. #2

    Default Re: php and console

    Dade wrote:
    > 1) how can i clear the screen? i tryed with system("cls") but doesn't work
    There is no such command. But you can just echo enough empty lines to
    clear the screen.

    greetings Christian
    Christian Fersch Guest

  4. #3

    Default Re: php and console


    "Christian Fersch" <Chronial@web.de> ha scritto nel messaggio
    news:cb41ar$tc5$05$1@news.t-online.com...
    > Dade wrote:
    > > 1) how can i clear the screen? i tryed with system("cls") but doesn't
    work
    >
    > There is no such command. But you can just echo enough empty lines to
    > clear the screen.
    >
    > greetings Christian

    Dade Guest

  5. #4

    Default Re: php and console


    "Christian Fersch" <Chronial@web.de> ha scritto nel messaggio
    news:cb41ar$tc5$05$1@news.t-online.com...
    > Dade wrote:
    > > 1) how can i clear the screen? i tryed with system("cls") but doesn't
    work
    >
    > There is no such command. But you can just echo enough empty lines to
    > clear the screen.
    >
    > greetings Christian
    yes, i also thought to this solution, the problem is move the cursor in the
    top - left position ....

    thanx
    Dade


    Dade Guest

  6. #5

    Default Re: php and console

    Dade spilled the following:
    >
    > "Christian Fersch" <Chronial@web.de> ha scritto nel messaggio
    > news:cb41ar$tc5$05$1@news.t-online.com...
    >> Dade wrote:
    >> > 1) how can i clear the screen? i tryed with system("cls") but doesn't
    > work
    >>
    >> There is no such command. But you can just echo enough empty lines to
    >> clear the screen.
    >>
    >> greetings Christian
    >
    > yes, i also thought to this solution, the problem is move the cursor in
    > the top - left position ....
    A better solution would be to use the ANSI emulation available in MS-DOS
    through Windows XP.

    See [url]http://is-it-true.org/nt/utips/utips181.shtml[/url] for instructions on how to
    enable it.

    You'll also need to know what codes to send to do particular things - the
    right way of doing it would be to use the ncusrses library but installing
    it on Microsoft is likely to be a pain. At
    [url]http://www.evergreen.edu/biophysics/technotes/program/ansi_esc.htm[/url] there is
    a well explain list of what sequences perform what operations.

    (PHP supports binary strings)

    HTH

    C.
    Colin McKinnon Guest

  7. #6

    Default Re: php and console

    Quote Originally Posted by Dade View Post
    hello all,
    i'm doing a program that run in console (ms-dos prompt), but i have 2 smalls
    problems:

    1) how can i clear the screen? i tryed with system("cls") but doesn't work
    2) how can i colorize the output of echo ?

    thanx all
    Dade
    1) First you need to know how you clear screen (Linux: clear, windows: cls) and then you could execute <?php passthru('clear');?> for example

    2) You could use Ansi but I don't know if it works in windows console
    rvntone is offline Junior Member
    Join Date
    Sep 2011
    Location
    Ecuador
    Posts
    1

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139