Jump to content

davidx714

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

davidx714's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Pikachu2000! YES! That did it. Thank you very much!!!
  2. I just tried "w" and the same thing happens: It works if $xx = 8; but it does not work if $xx = $linknum;
  3. Forgive my ignorance ... I just started learning ... can you show me what you did to get it to work?
  4. Hello everyone. I am trying to learn PHP and I am stuck. I have a text file that has the numbers 1 through 9, each listed on its own line. I want to read each line of the file, and write it to a new text file UNLESS one of the numbers is passed through the URL. So for example, if the url variable is 8, then it will read the first file and write 1 2 3 4 5 6 7 9 To the second file. Here is what I got: <?php $linknum = $_GET['linknum']; //----This works if $xx = 8; //$xx = 8; //----but it does not work if $xx = $linknum; $xx = $linknum; $data = file ("Source_file.txt"); $b = fopen("New_File.txt", "w+"); foreach ($data as $zz) { if ($zz != $xx){ fwrite($b, $zz); } } ?> Please help me!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.