fork(2) download
  1. <?php
  2. function CabecalhoPlanilha( $numero ) {
  3. $string = '';
  4. while( $numero ) {
  5. $string = chr( 65 + ( --$numero % 26 ) ) . $string;
  6. $numero = (int) ( $numero / 26 );
  7. }
  8. return $string;
  9. }
  10.  
  11. echo CabecalhoPlanilha( 26 ) . "\n";
  12. echo CabecalhoPlanilha( 27 ) . "\n";
  13. echo CabecalhoPlanilha( 1024 ) . "\n";
  14. ?>
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
Z
AA
AMJ