I have a strings that contain URLs, and I want to be able to select the whole string. By which I mean break up into an array, and replace with a different URL. I am just struggling to get my head around how to get the full URL, which is done presumably for searching for strpos of http, and then the strpos of the next white space, the next white space, but I cant seem to get my head around how to achieve this.
$test = 'testing the test http://www.effef.com this is the end';
echo $pos = strpos($test,'http');
In this string, we would want to get the string 'http://www.effef.com'
How can you create a variable of a string which is a URL from a string?