Order of operations!
while(($data = fgetcsv($handle,2000,'|')!==FALSE)){
PHP is interpreting this line as:
- Call
fgetcsv
- Without casting, compare it to boolean
false
- Assign the result of this comparison to
$data
This isn't what you want. Your parens are misplaced, you want the last one before the comparison:
while( ($data = fgetcsv($handle,2000,'|')) !== FALSE ){
I've added extra spaces to make the change more obvious.