D
D
Denis Shevchenko2018-03-21 12:22:33
PHP
Denis Shevchenko, 2018-03-21 12:22:33

How to process text in php and insert links to certain words?

For example, I have the text of an article and there is an array (string => link). In the text, these lines must be wrapped with links with the condition that you cannot insert a link into a link and the line may contain text like "Different* view", that is, the phrases "Different view", "Different view", etc. also fit the template. Maybe someone has ready-made solutions or libraries for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maiskiykot, 2018-03-21
@maiskiykot

So all through ob_start()->ob_get_contents() buffering and run the string through preg_replace type conversion ("!$slovo!","$arr[$slovo]",$string) before output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question