Jump to content

[SOLVED] php string question.


DamienRoche

Recommended Posts

Can I use a php string function to detect carriage returns and the start of new lines. Like th pre tags do.

 

Basically, I have a text file with some really long lines. WHat I want to do is put a <-p-> at the start of each line and a </-p-> at the end.

 

I already know how to use fopen etc. so it's just the string function I need to learn.

 

Has anyone got any ideas how I can do this?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/125001-solved-php-string-question/
Share on other sites

My long lines are being displayed none stop in the page.

 

like so:

 

I am a paragraph without a paragraph tab that is why I just can stop. ha that period doesn't stop me, I'm so clever, I just can stop. I am a paragraph without a paragraph tab that is why I just can stop. ha that

period doesn't stop me, I'm so clever, I just can stop. I am a paragraph without a paragraph tab that is why I just can stop. ha that period doesn't stop me, I'm so clever, I just can stop. I am a paragraph without a paragraph tab that is why I just can stop. ha that period doesn't stop me, I'm so clever, I just can stop. I am a paragraph without a paragraph tab that is why I just can stop. ha that period doesn't stop me, I'm so clever, I just can stop. I am a paragraph without a paragraph tab that is why I just can stop. ha that

period doesn't stop me, I'm so clever, I just can stop.

 

When really, it should break up a little. In the text file I just have really long lines for each paragraph.

 

I need to replace the start of each line with <-p-> and the end with </-p-> but I'm having trouble locating the beginning and the end of each line.

 

Thanks for the interest!

In the text file I just have really long lines for each paragraph.

 

And did you read (or try) the suggestion I made about using the file() function?

 

Yes, well, you are my hero right now :)

 

I was writing that really long reply at I just thought it'd be a waste to chuck it so submitted it any way.

 

The file(); function worked a treat!

 

Thanks for your time!

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.