Answer the question
In order to leave comments, you need to log in
How to write function replace_text?
Good afternoon.
I need help, there is a site - zhidkov-art.com/portfolio-item/artem-angelina/
I need to create a function replace_text to replace links (starting with fex.net/get/…) that I post in posts, automatically chained to
me thank you.
Answer the question
In order to leave comments, you need to log in
function replace_text($text) {
return preg_replace('/\s?(fex\.net\/get\/.*?)(\s|$)/', '<img src="//$1" alt="">', $text);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question