Jump to content

still stuck


stuckwithcode

Recommended Posts

Hello I have this code below that converts all types of line breaks to \r\n.

 

$text = preg_replace('#[\r\n]+#', "\n", $text);

 

But if there are 5 line breaks it groups them to 1.  I want to keep the number of line breaks the same, just make them all the same format.    If I remove the + it seems to double the actual number of line breaks.  Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/187263-still-stuck/
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.