Help with my code.
I want to remove the specific line in a txt file.
urls.txt
I want to remove the line AAAB0Ei5vrDEBAEtq2YkZAQLaM8hjVkYZAW9Mp18EXX7aQiXvN 4doWI5ZCxtmZCTUxqMKpS4M5VdPnTTv17P5UAcJ1sISfcikRkZ BtZBUHHBC1bC0150AkY
Can you help me? THANKS!
I want to remove the specific line in a txt file.
urls.txt
Code:
AAAB0Ei5vrDEBAEtq2YkZAQLaM8hjVkYZAW9Mp18EXX7aQiXvN4doWI5ZCxtmZCTUxqMKpS4M5VdPnTTv17P5UAcJ1sISfcikRkZBtZBUHHBC1bC0150AkY AAAB0Ei5vrDEBAAiULULE75kZBFmAOpRoX6eCXjANxhZARgOaHAbPWrHezuXI0kjTlNp9ZACu2UpSmVoZAl6kvSPCSREVMqEECBnmqNl7hC4CII8aML0r AAAB0Ei5vrDEBAM5g2xRtxFPaUNHGs5JQynt3H75l3j1CG0Kt8oroZCCiYZCkyMsySAGoHhm02syZA5Xl02976Q06NANbls8LxGMWFWCUhaLmDcCGW5M AAAB0Ei5vrDEBAFdKM3SZCitxYupspNFCKObBTATsGtsOerZAZB7YKxqfF49OiZBdScOYbRDn73AWqzRCj3sAlhIgG2QQzfCSCSBZCRAeOpIyEEdI7nqRZAWEW
Can you help me? THANKS!
PHP Code:
<?php
$file = fopen("urls.txt", "r");
$i = 0;
while (!feof($file)) {
$fb[] = fgets($file);
}
fclose($file);
foreach ($fb as $access_token){
$url="https://graph.facebook.com/me?fields=name&access_token=" . $access_token;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$cJSON = curl_exec($ch);
$feed=json_decode($cJSON, true);
$fbcomments = $feed["error"]["type"];
if($fbcomments=="OAuthException")
{
echo "<s>" .$access_token, "</s><br/>";
///REMOVE LINE CODE
}
else
{
echo "<b>" .$access_token, "</b><br />";
}
}
?>
Comment