note 79170 added to language.operators.arithmetic

From: Date: Wed, 14 Nov 2007 08:33:04 +0000
Subject: note 79170 added to language.operators.arithmetic
Groups: php.notes 
Request: Send a blank email to php-notes+get-132255@lists.php.net to get a copy of this message
Here's a neat little trick to use ASCII escape codes to show processing in a CLI script. #!/usr/bin/php -q <?php //http://www.cs.csubak.edu/Tables_Charts/VT100_Escape_Codes.html define('ESC', 27); printf( "%c[2J", ESC ); //clear screen //note how the '-' is at [1], not [0] $cursorArray = array('/','-','\\','|','/','-','\\','|'); echo "Processing: "; printf( "%c7", ESC ); //save cursor position for ($count = 1; $count <= 30; $count++) { //note that $i is all self contained. printf("%c8(".$cursorArray[ (($i++ > 7) ? ($i = 1) : ($i % 8)) ].") %02d", ESC, $count); //restore cursor position and print sleep(1); } echo "\nDone.\n"; ?> ---- Server IP: 208.69.120.35 Probable Submitter: 67.168.161.74 ---- Manual Page -- http://www.php.net/manual/en/language.operators.arithmetic.php Edit -- https://master.php.net/note/edit/79170 Del: integrated -- https://master.php.net/note/delete/79170/integrated Del: useless -- https://master.php.net/note/delete/79170/useless Del: bad code -- https://master.php.net/note/delete/79170/bad+code Del: spam -- https://master.php.net/note/delete/79170/spam Del: non-english -- https://master.php.net/note/delete/79170/non-english Del: in docs -- https://master.php.net/note/delete/79170/in+docs Del: other reasons-- https://master.php.net/note/delete/79170 Reject -- https://master.php.net/note/reject/79170 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132255) next »