How to read line by line in php

后端 未结 5 1248
北荒
北荒 2021-01-06 11:21

when i try to insert each line into my oracle database i get an error stating invalid number, but if have only one line in the file it works fine.

$file = @f         


        
5条回答
  •  情话喂你
    2021-01-06 11:54

    $lines = explode("\n", str_replace("\r", "", file_get_contents("file.text")));
    
    foreach ($lines as $line)
    {
         insert(explode('        ', $line);
    }
    

提交回复
热议问题