Reading Data From .CSV Files

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Sat Jun 21, 2003 10:17 pm

getcvs works unperfect... sorry.

try to use explode or regular expresion for this.

New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Sun Jun 22, 2003 8:32 am

Code: Select all

while($data = fgetcsv ($fp, 1024, ","))
  echo ($data[11] == $country) ? $data[1]. ' from ' .$data[11]. '<br />' : '' ;

you were using an assignment = in your if clause ( if(a=b) should be if(a==b)) and muddling a few vars around.

try the above anyway.

subnote: be sure to set $country to some value somewhere
avatar image based upon nasas apod (only updates if I post though)

Post Reply