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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.