Answer the question
In order to leave comments, you need to log in
How to remove everything except the image url?
Good afternoon, you need a regular expression that will find only the url of the image in the entire text, and delete everything else. Partially copes with this
$text = preg_replace('~(https?://\S+)|.~su', '$1', $text);
, but a little different :( Answer the question
In order to leave comments, you need to log in
$text = preg_replace('~.*?(https.*jpg).*~g', '$1', $text); //https://i.imgur.com/mtbl1cr.jpg
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question