OOPS! MY MISTAKE, here:
If the files data is all on one line, which I am assuming it is if its fields are split by |=|, and it starts on line 1, then this should do it,,,
<?
$itemtoremove="elementtoremove";
$newvalue="";
$fileread=file('textfile.txt');
$fileread=$fileread[0];
$arrayfill=explode("|=|",$fileread);
$count=count($arrayfill);
for($n=0;$n<$count;$n++){
if($arrayfill[$n]==$itemtoremove){
$arrayfill[$n]=$newvalue;
}
}
$textstring=implode($arrayfill,"|=|");
$filewrite=fopen('textfile.txt',"W");
fputs($filewrite,$textstring);
fclose($filewrite);
?>
Can you email me the text file? this would be easier by email, I know I can have a solution for you.
contact@pyroxpro.com