I have a text file that contains a bunch lines of text, formatted as
latitude longitude time
22.300859182388606 -127.66133104264736 1528577039
22.30103320995603 -127.66234927624464 1528577041
22.300184137952726 -127.661628767848 1528577042
22.29943548054545 -127.66242001950741 1528577045
I am given coordinates and I want to search the text file for the same coordinates, and if there are, delete the line from the file. How do I search for the same coordinates as the given coordinates and delete it from the file? This is the code that I have so far:
<?php
$msg = $_GET["coords"];
$file = 'coordinates.txt';
// Open the file to get existing content
$current = file_get_contents($file);
?>