ASCII Printer v0.1

Published on 2007-11-22 01:50:26.

tags = {  "math" "fun" "php"   };

bookmarks = {  Digg! , Del.icio.us! , Google! , Slashdot! , Netscape! , Technorati! , Yahoo! , Stumbleupon! };

Description

PHP script that prints the list of printable ASCII characters.

Content

   1  
   2  #!/usr/bin/php
   3  <?php
   4   
   5  /**
   6   *
   7   * @project name:        ASCII_Printer
   8   * @author:              Zapotek <zapotek@segfault.gr>
   9   * @file description:    Prints the list of printable ASCII characters
  10   *
  11   */

  12  
  13  define( 'VERSION', 0.1 );
  14  
  15  define( 'PRINTABLES_START', ord( ' ' ) );
  16  define( 'PRINTABLES_END', ord( '~' ) );
  17  
  18  echo "\nASCII Printer v". VERSION .
  19       "\nPrints the list of printable ASCII characters.\n" .
  20       "by Zapotek <zapotek [at] segfault.gr>\n" .
  21       "<http://www.segfault.gr>\n\n";
  22       
  23  for( $i = PRINTABLES_START; $i <= PRINTABLES_END; $i++ ) {
  24      echo "$i\t" . sprintf( "'%c'", $i ) . "\n";
  25  }
  26  
  27  echo "\n";
  28  
  29  ?>
  30  
  31   
Code statistics
Physical lines Code lines Comment lines Empty lines Size
30 [ 100.00% ] 13 [ 43.33% ] 7 [ 23.33% ] 10 [ 33.33% ] 629 bytes
[ Download ]