Bro, please help me
2020-09-20 12:23:48
0
1
1069

$keywords = "Keyword 1, Keyword 3, Keyword 2"

$body = "This is a piece of content, there will be html code in the content"

Now it is random Extract a value from $keywords and randomly insert it into $body. I tried it myself and it inserted it into the html tag. How can I avoid inserting it into the html tag?

$len=mb_strlen($body) ;

$rad1=rand(0,$len);

$rad2=rand(0,sizeof($keywords)-1);

$s1=mb_substr ($body,0,$rad1);

$s2=mb_substr($body,$rad1,$len);

$body = $s1.$ keywords[$rad2].$s2;

Now the code is like this, please help

reply all(1)
大瓶可乐

You can replace the html with a placeholder first.

After the random insertion is completed, replace the placeholder back to the old html

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template