-1

I have a PHP string that looks like this:

$text_output .= '<strong>'.substr($k, $pos).'</strong>'."\n";

The substr($k, $pos) outputs, for example, a text looking like this:

Well.this.is.quite.a.long.sentence.considering.all.the.dots.used.here.within.wich.will.break.page.if.it.is.too.long

This means it often make the page non mobile-friendly if the sentence it outputs is very long. Therefore I need to add a piece of code that replaces all dots "." with a space " ". So in the end the output I would want is this:

Well this is quite a long sentence considering all the dots used here within wich will break page if it is too long

panterara
  • 7
  • 4

1 Answers1

0

Try with

str_replace("."," ",substr($k, $pos));
Maninderpreet Singh
  • 2,569
  • 2
  • 17
  • 31