Jump to content

read file and cut text in peaces


ijsselg

Recommended Posts

Hi,

 

I want to read a file, and while reading

 

I want to put the first line (before the first \n) in variable one

second line in variabele two

third line in variabele three.

 

And I want to use it in html:

 

$text = str_replace("\n","<br>",file_get_contents($file));

 

Anyone can help a little?

Link to comment
https://forums.phpfreaks.com/topic/274450-read-file-and-cut-text-in-peaces/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.