<?php
$file_to_work = 'strings.txt';
if(is_file($file_to_work) && is_readeable($file_to_work) && filesize($file_to_work)){
$fp = fopen($file_to_work,'r');
if($fp && is_resource($fp)){
flock($fp,LOCK_EX);
$content = '';
$line = false;
while(($line = fgets($fp)) !== false){
if(!preg_match('~[a-z]~iu',$line)){
$content .= $line."\n";
}
}
flock($fp,LOCK_UN);
fclose($fp);
if(!empty($content)){
$fp = fopen($file_to_work,'w+');
if($fp && is_resource($fp)){
flock($fp,LOCK_EX);
fwrite($fp,$content);
flock($fp,LOCK_UN);
fclose($fp);
}
}
}
}
?>