Hello, I have a text file , filled with pipe separated URLs, like this:
http://www.example.com|http://www.example2.com|http://www.example3.com|....
etc.
I currently have this code to read each url from the file and pass it to a function:
<?php
$urlarray = explode("|", file_get_contents('urls.txt'));
foreach ($urlarray as $url) {
function1($url);
}
?>
What I want to do next is, after function1() is done, delete that URL from the text file.That way, when the script is done going through all the URLs in urls.txt, this text file should be empty.
How can I achieve this?
Thanks, Rafael