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.
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

