Schlo_50 Posted March 31, 2008 Share Posted March 31, 2008 I have a .DAT file which I want to remove lines from. I have some code but it needs tweaking, as it doesn't delete any lines from my file at all. if ($_GET['action'] == "delete"){ foreach($file as $key => $val){ $data[$key] = explode("|", $val); if($_GET['pid'] == $data[$key][0]) { unset($file[$key]); $fp = fopen("data/customer.DAT", "w"); fwrite($fp, implode('', $file)); fclose($fp); print "Deleted"; } } } Thanks in advance guys! Link to comment https://forums.phpfreaks.com/topic/98780-fwrite/ Share on other sites More sharing options...
Schlo_50 Posted March 31, 2008 Author Share Posted March 31, 2008 Have Solved! Link to comment https://forums.phpfreaks.com/topic/98780-fwrite/#findComment-505476 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.