使用CI File Helper读取文件的新行的特殊字符

Good afternoon.

So i have this issue with CodeIgniter.

Im reading a file using the file helper of CI

$this->load->helper('file');
$data = read_file('file.txt');

The problem is that the line

$data = read_file('file.txt');

returns a string with all the content of the file and I need to read each line of the file to make some operations.

I just tried this:

$data_array=  explode('
',$data);

But when i do

sizeof($data_array);

its output is 1.

So. What is the special character that i need to use in order to properly explode the string?

Thanks in advance for the answers.

Use with double quotes (not single quotes):

$data_array = explode("
", $data);

Line endings are depend on operation system, they can be , , or in different systems

So, you can either use file or mb_split with [ ]+ as pattern