Jump to content

chris22

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chris22's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 1 0.0 0.0 2 10.1 -10.1 3 -12.2 12.2 4 38.3 38.3 5 79.99 179.99 ^^ Contents of input file.
  2. I have the following code: <?php $lines = count(file("input.txt")); $file = fopen("input.txt", "r"); for($i=0; $i<=$lines; $i++) { $friend = fgets($file); $friendInfo = explode(" ", $friend); $friendID[$i] = $friendInfo[0]; $friendLAT[$i] = $friendInfo[1]; $friendLONG[$i] = $friendInfo[2]; echo $friendInfo[2]; echo $friendLAT[$i]; } fclose($file); ?> The value of $friendInfo[2]; and $friendLAT[$i]; echo out alright. However I get the following output: It doesn't make any sense to me, I can assign the value of the array to a variable ($friendLAT[$i], but it says the offset is undefined.
×
×
  • 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.