Jump to content

valandor

Members
  • Posts

    12
  • Joined

  • Last visited

Community Answers

  1. valandor's post in How to creat a line break in a look was marked as the answer   
    You can try using  chunck_split() something like $string = chunk_split($string, '128', '<br />'); This worked on a large string I randomly generated.
     
     The reason that the nl2br() method doesn't work for you is because there are no new lines (\r\n) in your string. nl2br() converts those new line characters to <br /> tags. If there are going to be new lines in your text you can use the nl2br().
     
    You can use the word-wrap function as well. If it's going to be one long word like all of your a's you would want to set the optional Boolean at the end to true to cut a word at the breaking point, otherwise it's going to wait till the end of the word to add the <br /> character into it... So in your case of all the A's it'll add it in after the last "a" doing a whole lot of nothing for you.
×
×
  • 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.