Jump to content

st33l3rsfan

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

st33l3rsfan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Chris! I'm a Smith too. Welcome.
  2. Ok, so I turned on formatting in npp+(notepad +) and it is delimited by spaces. I changed it to tabs and it worked!! Thanks so much!! I really do appreciate the help and gentle nudge in the right direction. Cheers!
  3. Thanks so much for the direction! I follow the logic for sure. When I tried to run it I got this error Notice: Undefined offset: 3 in C:\wamp\www\transit\write_file.php on line 34 Notice: Undefined offset: 2 in C:\wamp\www\transit\write_file.php on line 34 Notice: Undefined offset: 1 in C:\wamp\www\transit\write_file.php on line 34 zip = 00501 NYHoltsville Suffolk 840 , city = , county = , code = It still wants to shove everything in zip. I tried using the " " space delimiter but it just assigned an index to every character. Any thoughts? Again thanks.
  4. All, So I have a text file I'm reading into an array that looks like this: TEST.TXT 00501 NYHoltsville Suffolk 840 00544 NYHoltsville Suffolk 840 00601 PRAdjuntas Adjuntas 840 00602 PRAguada Aguada 840 00603 PRAguadilla Aguadilla 840 I read this into an array using this snippet: if ($zips=file("test.txt")){ $i=0; foreach($zips as $zip){ echo "\$zips[$i] => $zip.\n"; $i++; } } My output is this: zips[0] => 00501 NYHoltsville Suffolk 840 . $zips[1] => 00544 NYHoltsville Suffolk 840 . $zips[2] => 00601 PRAdjuntas Adjuntas 840 . $zips[3] => 00602 PRAguada Aguada 840 . $zips[4] => 00603 PRAguadilla Aguadilla 840 . What I want to do is break the index up so say, zips[0] would be $zipc =00501, $state=NY, $city=Holtsville, $county=Suffolk, $countryCode=840. I have read chapters on arrays and consulted php.net but I feel the answer is eluding me and perhaps I don't know what to look for exactly. Any help is appreciated! Thanks so much! in advance. You can email me at playa86 AT gmail DoT com.
  5. Hey Andy! I'm a noob too but I loved your subject line! Reference to Robert Englund???
  6. Hey there!! I'm new too!! Welcome.
  7. Hello, everyone! I'm new to writing PHP in my 2nd career and look forward to contributing as soon as I can as well as requesting assistance. Hope to help make an impact. Have a great day!
×
×
  • 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.