I am trying to extract URL out of a string. The format of the string will be:
some text! some numbers http://linktoimage.com/image
I found this post earlier Extract URLs from text in PHP
and I think this solution mentioned there could work:
<?php
$string = "this is my friend's website http://example.com I think it is coll";
echo explode(' ',strstr($string,'http://'))[0]; //"prints" http://example.com
However I do not understand what it actually does. Would someone mind explaining this to me to me ?