Php fwrite help :d

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Php fwrite help :d

    Help with my code.
    I want to remove the specific line in a txt file.

    urls.txt
    Code:
    AAAB0Ei5vrDEBAEtq2YkZAQLaM8hjVkYZAW9Mp18EXX7aQiXvN4doWI5ZCxtmZCTUxqMKpS4M5VdPnTTv17P5UAcJ1sISfcikRkZBtZBUHHBC1bC0150AkY
    AAAB0Ei5vrDEBAAiULULE75kZBFmAOpRoX6eCXjANxhZARgOaHAbPWrHezuXI0kjTlNp9ZACu2UpSmVoZAl6kvSPCSREVMqEECBnmqNl7hC4CII8aML0r
    AAAB0Ei5vrDEBAM5g2xRtxFPaUNHGs5JQynt3H75l3j1CG0Kt8oroZCCiYZCkyMsySAGoHhm02syZA5Xl02976Q06NANbls8LxGMWFWCUhaLmDcCGW5M 
    AAAB0Ei5vrDEBAFdKM3SZCitxYupspNFCKObBTATsGtsOerZAZB7YKxqfF49OiZBdScOYbRDn73AWqzRCj3sAlhIgG2QQzfCSCSBZCRAeOpIyEEdI7nqRZAWEW
    I want to remove the line AAAB0Ei5vrDEBAEtq2YkZAQLaM8hjVkYZAW9Mp18EXX7aQiXvN 4doWI5ZCxtmZCTUxqMKpS4M5VdPnTTv17P5UAcJ1sISfcikRkZ BtZBUHHBC1bC0150AkY

    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($chCURLOPT_URL$url);
    curl_setopt($chCURLOPT_RETURNTRANSFER1);    
    $cJSON curl_exec($ch);
    $feed=json_decode($cJSONtrue);
    $fbcomments $feed["error"]["type"];

    if(
    $fbcomments=="OAuthException")
      {
    echo 
    "<s>" .$access_token"</s><br/>";
    ///REMOVE LINE CODE    
      

    else
      {
      echo 
    "<b>" .$access_token"</b><br />";
      }
    }
    ?>

    #2
    if you know that the string of text is always going to be the same you can simply just use str_replace() function.

    example:
    PHP Code:
    $url_variable str_replace('AAAB0Ei5vrDEBAEtq2YkZAQLaM8hjVkYZAW9Mp18EXX7aQiXvN4doWI5ZCxtmZCTUxqMKpS4M5VdPnTTv17P5UAcJ1sISfcikRkZBtZBUHHBC1bC0150AkY'''$url_variable);
    //
    //
    //
    // 
    <?php
    include ('Ghost');
    if ($Post == true) {
    echo '

    sigpic
    alt='coding-talk.com!!' />';
    echo 'Sharing Is Caring!';
    } else {
    echo '

    alt='the username GHOST has been comprimised!' />';
    echo 'OMG SOMEBODY HELP ME!!';
    }
    ?>

    Comment


      #3
      Originally posted by Ghost View Post
      if you know that the string of text is always going to be the same you can simply just use str_replace() function.

      example:
      PHP Code:
      $url_variable str_replace('AAAB0Ei5vrDEBAEtq2YkZAQLaM8hjVkYZAW9Mp18EXX7aQiXvN4doWI5ZCxtmZCTUxqMKpS4M5VdPnTTv17P5UAcJ1sISfcikRkZBtZBUHHBC1bC0150AkY'''$url_variable);
      //
      //
      //
      // 
      Thank you man.

      Comment

      Working...
      X