ALeX
18:35:29
11.03.2010
Welcome
Home
Contact
Disclaimer
Links
Mac
PHP
Home
Code Twister
phpico
ncurses
AddressBook
fli4l
Amiga
C64
Deutsch
Printable version
Show Link
Config
NOTICE:
The browser you are using
is not able to display
CSS properly! Use another
browser, e.g. Firefox.


ncurses1.php 1.0 (2003-06-19)

This is an example how to use the ncurses library.
It displays a (big) text in a scrollable window.
Read the manual within the source.
It will look like the demo below.
Comments, suggestions? Mail me.

View the source
Download the source

A Mac OS X command line version of php which has ncurses support is available here.
+- ncurses example --------------------------------------+
|<?php                                                   |
|                                                        |
|    /* start me with "allkeys" as arument to use all key>
|                                                        |
|    // read this file as text                           |
|    $text = file($_SERVER['PATH_TRANSLATED']);          |
|                                                        |
|    // strip off any whitespaces (space, newline, ...) a>
|    // and replace tabs by 4 spaces                     |
|    foreach($text AS $k=>$v)                            |
|        if(preg_match('/^(.*?)\s*$/', strtr($v, array("\>
|            $text[$k] = $r[1];                          |
|                                                        |
|    // question                                         |
|    $question = array(                                  |
|        ' This is an more complex example for ncurses', |
+- line 1-16/202 ----------------------------------------+
+--------------------------------------------------------+
| This is an more complex example for ncurses            |
| Use the arrow keys to scroll / ESC or Q to exit        |
+--------------------------------------------------------+



©2003 ALeX Kazik · last update 19. Jun 2003