This question already has an answer here:
- Extract URLs from text in PHP 11 answers
How can we use PHP to identify URL's in a string and store them in an array?
Cannot use the explode
function if the URL contains a comma, it wont give correct results.
REGEX is the answer for your problem. Taking the Answer of Object Manipulator.. all it's missing is to exclude "commas", so you can try this code that excludes them and gives 3 separated URL's as output:
and the output is
You can try Regex here:
This gives the following output:
try this
or
it will works
please try to use below regex
Hope this will work for you