Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/01/2010, 14:22
nat_chan07
 
Fecha de Ingreso: enero-2010
Mensajes: 62
Antigüedad: 16 años, 8 meses
Puntos: 1
Respuesta: Cadena de texto a variables (obtener y buscar texto)

algo como esto?

Código PHP:
<html>

<head>
  <title></title>
</head>


<?php

$texto 
=  "archivo_de_texto.txt";
$handle = @fopen($texto, "r");



if (
$handle) {  ?>

    <TABLE style="border: 2px dotted gray;margin-right:auto;margin-left:auto;">
    <tr style="text-align:center;background-color:#4a6890;color:#fff;">
    <td width="61">USUARIO</td>
    <td width="61">REGISTRO</td>
    <td width="61">PRIVILEGIOS</td>
    <td width="61">ULTIMOACCESO</td>

  </tr>
    <?
    
while (!feof($handle)) {
        
$buffer = fgets($handle);

          
?>
                <? $usuario = substr("$buffer",7, 3);
                   
$registro = substr("$buffer",20, 8);
                   
$privilegios = substr("$buffer",41, 3);
                   
$ultimoacceso = substr("$buffer",58, 5);
                   
?>
<TR>
                <TD><? echo $usuario . "\n";?></TD>
                <TD><? echo $registro . "\n"; ?></TD>
                <TD><? echo $privilegios . "\n"; ?></TD>
                <TD><? echo $ultimoacceso . "\n"; ?></TD>
                 </TR>
           <?

                 
}
    
fclose($handle);  ?>
     </TABLE>
                       <? echo '<br>'; ?>

<? } ?>
</body>
</html>