SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast reynierpm's Avatar
    Join Date
    Dec 2004
    Location
    Cuba
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Read and mantain format from a txt file

    Well I use this simple code to read a content store in a file:
    PHP Code:
     $file "gerencia.txt";
     
    $handle fopen($file,"r");
     
    $contents fread($handlefilesize($file));
     echo 
    $contents;
     
    fclose($handle); 
    but when I print the result in the browser did not have a format result. This is the format store in the TXT file:
    16/03/2005 TELECOMUNICACIONES DE MEXICO
    DIRECCION DE ADMINISTRACION PAGINA: 1
    15:38:17 SUBDIRECCION DE RECURSOS HUMANOS
    LISTADO DE FIRMAS POR CHEQUES DEL 16/03/2005 AL 31/03/2005
    NOMINA ORDINARIA QNA 06/2005
    PERSONAL OPERATIVO


    PROYECTO Y ACTIVIDAD : 004 P038 SERVICIOS TELEGRAFICOS FINANCIEROS Y DE COMUNICACIONES
    ZONA DE PAGO : 120
    UNIDAD : 4212 GERENCIA DE GUERRERO
    CENTRO DE DISTRIBUCION: 1212000001 CHILPANCINGO GRO. ORD-14-1-1-200506-4212
    ------------------------------------------------------------------------------------------------------------------------------------
    FILIACION N O M B R E C L A V E -----P E R I O D O----- No. Cheque N E T O F I R M A
    ------------------------------------------------------------------------------------------------------------------------------------

    AONE71062701 EFRAIN ANTONIO NOLASCO A01003 000001 16/03/2005 - 31/03/2005 000000000 1,723.29 _______________1

    AONR69082901 ROSALBA ANTONIO NOLASCO A01009 000001 16/03/2005 - 31/03/2005 000000000 2,131.02 _______________2
    How I do this?

  2. #2
    SitePoint Zealot stdlist's Avatar
    Join Date
    Sep 2004
    Location
    Corvallis, OR, USA
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change the echo statement to echo "<pre>$content</pre>";

  3. #3
    SitePoint Enthusiast reynierpm's Avatar
    Join Date
    Dec 2004
    Location
    Cuba
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks

    This is I what looking for.
    Regards


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •