note 9006 added to fgetcsv

From: Date: Wed, 11 Oct 2000 01:04:36 +0000
Subject: note 9006 added to fgetcsv
Groups: php.notes 
Request: Send a blank email to php-notes+get-6336@lists.php.net to get a copy of this message
In this ex. I will write in a text file using "|" as delimiter between each field and then I will use fgetcsv to read it: fwrite($fp,$cod."|"); fwrite($fp,$name."|"); fwrite($fp,$country."\n"); You will have a file like this one: 12|Mark Brown|BRAZIL 22|Half Ever|USA to read the file use: $fotoinfo=fgetcsv($fp,1000,"|"); list($cod,$name,$country)= $fotoinfo; echo "$cod\t"; echo "$name\t"; echo "$country\n"; PHP will display: 12 Mark Brown BRAZIL http://www.php.net/manual/function.fgetcsv.php

« previous php.notes (#6336) next »