-
fgetcsv won't give me my array
I trying to read a file so I can put it into my database. The problem is that the function fgetcsv won't separate it into an array, but just as a single array[0]. What am i missing here?
<?php
$handle = fopen("input.txt", "r");
while (($data = fgetcsv($handle, 1000, "*")) !== FALSE) {
print $data[0];
print $data[1];
}
fclose($handle);
?>
The input file is a number count to ten separated by "*". Odd thing it sometimes works once.
-
-
Never mind I figured it out. Apparently I'm not allowed to use returns after my separator
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks