Ver Mensaje Individual
  #10 (permalink)  
Antiguo 06/05/2010, 13:02
Hidek1
Colaborador
 
Fecha de Ingreso: octubre-2009
Ubicación: Tokyo - Japan !
Mensajes: 3.867
Antigüedad: 14 años, 6 meses
Puntos: 334
Respuesta: Crear .txt con formato

Código PHP:
Ver original
  1. <?php
  2. $max = 50;
  3. $relleno = "0";
  4.  
  5. $cadena = "PRUEBA";
  6. echo sprintf('%'.$relleno.''.$max.'s', $cadena);
  7.  
  8. echo "<br />";
  9.  
  10. $cadena = "PRUEBA NUMERO 2";
  11. echo sprintf('%'.$relleno.''.$max.'s', $cadena);
  12.  
  13. echo "<br />";
  14.  
  15. $max = 30;
  16. $cadena = "PRUEBA NUMERO 3";
  17. echo sprintf('%'.$relleno.''.$max.'s', $cadena);
  18. ?>
__________________
More about me...
~ @rhyudek1
~ Github