how to assign csv data into three different variables
Posted: Tue May 06, 2008 7:05 am
i have csv file contains username,firstname, and emails.
i want assign three variables from csv file seperately what i will do for that
this is code:
$fcontents = file('C:\Documents and Settings\winfo2\Desktop\user.csv');
# expects the csv file to be in the same dir as this script
for($i=1; $i<sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode("\t", $line);
print_r( $arr);
i want assign three variables from csv file seperately what i will do for that
this is code:
$fcontents = file('C:\Documents and Settings\winfo2\Desktop\user.csv');
# expects the csv file to be in the same dir as this script
for($i=1; $i<sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode("\t", $line);
print_r( $arr);