todos los archivos tienen 2 llaves (+DFHDB2023I y +DFHSI1517) que me sirven para identificar las lineas que deseo...
de que manera puedo momorizar toda la linea donde se enceuntra la palabra de busqueda?? en mi caso deseo toda la linea donde esta ubicado +DFHDB2023I y +DFHSI1517
Código:
+DFHSJ0101I CICSCI4C 715 The JVM (SJ) domain for Java has started initializing. Java is a trademark of Oracle and/or its affiliates +DFHDB2023I 11/25/2015 09:51:34 CICSCI4C The CICS-DB2 attachment has connected connected to DB2 subsystem DB1F +DFHAP1211I CICSCI4C Language Environment initialization completed. +DFHSI1517 CICSCI4C Control is being given to CICS DFHAM4893 I 11/25/2015 09:51:34 CICSCI4C Install for group SVT$SMP has completed successfully.
Cita:
+DFHDB2023I 11/25/2015 09:51:34 CICSCI4C The CICS-DB2 attachment has connected connected to DB2 subsystem DB1F
Código:
hice este script pero no funciona...+DFHSI1517 CICSCI4C Control is being given to CICS
Código PHP:
<?php
$filename = "../txt/test.txt";
$var=fopen($filename, "r");
$leo=fread($var, filesize($filename));
fclose($var);
$contenido=nl2br($leo);
$controlo = strstr ($contenido, '+DFHDB2023I');
$controlo1 = strstr ($contenido, '+DFHSI1517');
if ($controlo) {
echo "<p>OK EXISTE</p>";
echo "<p>LINEA +DFHDB2023I</p>";
echo $controlo;
echo "<p>LINEA +DFHSI1517</p>";
echo $controlo1;
}
?>
Código:
se supone que deberia darme como resultado solo:OK EXISTE LINEA +DFHDB2023I +DFHDB2023I 11/25/2015 09:51:34 CICSCI4C The CICS-DB2 attachment has connected connected to DB2 subsystem DB1F +DFHAP1211I CICSCI4C Language Environment initialization completed. +DFHSI1517 CICSCI4C Control is being given to CICS DFHAM4893 I 11/25/2015 09:51:34 CICSCI4C Install for group SVT$SMP has completed successfully. LINEA +DFHSI1517 +DFHSI1517 CICSCI4C Control is being given to CICS DFHAM4893 I 11/25/2015 09:51:34 CICSCI4C Install for group SVT$SMP has completed successfully.
Código:
y sin embargo el resultado es desde esa linea hasta el final del archivo....OK EXISTE LINEA +DFHDB2023I +DFHDB2023I 11/25/2015 09:51:34 CICSCI4C The CICS-DB2 attachment has connected connected to DB2 subsystem DB1F LINEA +DFHSI1517 +DFHSI1517 CICSCI4C Control is being given to CICS
alguna idea?
gracias anticipadas
salu2
Italo.