<?php
$headersArray = array(
'wcatwc'=> array('0'=>'WEPA41 PAAQ','1'=>'WEPA43 PAAQ','2'=>'SEAK71 PAAQ','3'=>'SEUS71 PAAQ ','4'=>'WEAK51 PAAQ ','5'=>'WEAK53 PAAQ ',
'6'=>'WEXX20 PAAQ ','7'=>'WEXX22 PAAQ ','8'=>'WEXX30 PAAQ ','9'=>'WEXX32 PAAQ ','10'=>'SEXX60 PAAQ ','11'=>'NTXX98 PAAQ ',),
'ptwcheaders'=>array('12'=>'WEPA42 PHEB', '13'=>'WEHW40 PHEB' ,'14'=>'WEHW42 PHEB' ,'15'=>'SEHW70 PHEB','16'=>'WECA41 PHEB','17'=>'WECA43 PHEB',
'18'=>'WEIO21 PHEB','19'=>'WEIO23 PHEB','20'=>'NTXX98 PHEB'),
);
$found = false;
//Open the file
$filename = "ptwc.txt";
$fp = fopen($filename,"rb") or die ("file Cannot be opened");
//Read the file
$data = fread($fp, filesize($filename));
while(!feof($fp))
{
$data .=fgets($fp, 1024);
}
//close the file
fclose($fp);
//Break up the line
$line = explode("\r\n", $data);
//Search the file for a sting that matches and dispplays the line
echo $headersArray['wcatwc'];
$x = 0;
$i= 0;
switch ($i)
{
case 0: $i=0;
break;
case 1:$i=1;
break;
case 2: $i=2;
break;
case 3: $i=3;
break;
}
foreach($line as $line)
{
if(strpos($line, $headersArray['wcatwc'][$x]) !== false)
{
echo $line;
}
if(strpos($line, $headersArray['ptwcheaders'][$i]) !== false)
{
$found= true;
echo $line;
}
}
?>