Faced the problem of breaking words in the text when inserting a particular line. Ie there is a text, with the help of one function ( substr ) the text is torn in half, put into a variable (by the way, it is used by random to insert in a random place and because of this it’s not what you need). Almost the second part is obtained in this way. Then it all comes together. It’s clear that when dividing a text into two parts, one of the words is accidentally divided, and then the line itself is inserted into this gap. Here is the script itself :
<?php $text = 'наш любимый текст текст текст'; $good = strlen($text); $ran = rand(0,$good); $string = " <b>Скачать чит</b> "; $text1 = substr ($text, 0,$ran); $text2 = substr ($text, $ran); echo $text1 . $string . $text2; ?>