1

At the moment whenever there are more than 300 characters the string stops, halfway through a word as well, and begins on a new line.

I want it to be able to continue on the same line where it left off but it just starts on a new line.

Example of how it breaks

This will break at 300 charac
ters

Want to achieve

This will break at 300 characters

My code

@if (strlen($server->description) >= 300) 
   {!! nl2br(mb_substr(html_entity_decode($server->description), 0, 300)) !!}
     <div class="collapse" id="collapse{{$server->id}}">
          {!! nl2br(mb_substr(html_entity_decode($server->description), 300)) !!}
     </div>


n212
  • 517
  • 1
  • 11
  • 29
  • 1
    Does this answer your question? [Get first 100 characters from string, respecting full words](https://stackoverflow.com/questions/972010/get-first-100-characters-from-string-respecting-full-words) – Odin Thunder May 13 '20 at 14:30

0 Answers0