Jump to content

[SOLVED] Best way to force a line break in HTML


transparencia

Recommended Posts

wordwrap might work out for you.  By default it inserts a \n at the length you specify, without breaking the word (will move the whole word to next line), but you can specify what it inserts and you can flag it to break at that length no matter what.  Only problem I see with wordwrap is how long your string is.  If you're only wanting to break it once, and it's a long string, it will keep adding the <br />'s every x length you specify.

 

If that isn't going to work for you, you could always use substr to half the string at your length and concat them all together.

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.