How to bold mismatched parts?

There is a database of links, we insert a link in the search database, for example https://domain1.ru/imgs/123 and search gives the following results:
https://domain1.ru/imgs/123
https://domain1.ru/imgs/1230
https://domain1.ru/imgs/1231
https://domain1.ru/imgs/1232

how to make so that the output is shown here:

https://domain1.ru/imgs/123
https://domain1.ru/imgs/1230
https://domain1.ru/imgs/1231
https://domain1.ru/imgs/1232
April 4th 20 at 00:59
2 answers
April 4th 20 at 01:01
Solution
look at the task differently: allocate each result – search string. And the rest make bold )

Help easy to replace str_replace(), or if possible multiple occurrence of the search fragment in the string, preg_replace().

To replace the search string it the same in the wrapper, for example, the tags <span>search string</span>. Gimoto/airnote to make styles.
April 4th 20 at 01:03
Solution

Find more questions by tags PHP