Prova così:
Codice PHP:
<?
//1
$pattern=""; //modifica
$file=""; //modifica
foreach(file($file) as $line){
if(strpos($pattern,$line))
echo $line;
}
?>
Codice PHP:
<?
//2
$pattern="error";
foreach(glob("*.log") as $file){
foreach(file($file) as $line){
if(strpos($pattern,$line)){
echo $line;
}
}
}
?>
Codice PHP:
<?
//3
$pattern="error";
foreach(glob("*.log") as $file){
foreach(file($file) as $line){
if(strripos($pattern,$line)){
echo $line;
}
}
}
?>
Codice PHP:
<?
//5
$pattern="info";
foreach(glob("*.log") as $file){
foreach(file($file) as $line){
if(!strpos($pattern,$line)){
echo $line;
}
}
}
?>
Il quarto metodo nn l'ho capito