Thanks, I just needed a little assurance that I wasn't going to waste my time 🙂 I figured it out. There might be an easier way to do it, but this is what I came up with...
$path = ".";
$productFile = $path."/products.txt";
$searchKey = "product2";
if (file_exists($productFile)) {
$fp = fopen($productFile, "r");
while(!feof($fp)) {
$ftext .= fread($fp, 1024);
}
$fentry = explode("\r",$ftext);
for($i=0;$i<sizeOf($fentry);$i++) {
$flineentry = explode("\t",$fentry[$i]);
for($j=0;$j<sizeOf($flineentry);$j++) {
$entryResult = trim($flineentry[$j]);
if($entryResult==$searchKey) {
// echo("match<br/>");
$result = trim($flineentry[$j+1]);
break;
}
}
}
echo("result=".$result);
} else {
echo("result=");
}