PHP move links to end of string
<p>in a string with one URL such as </p>

<pre><code>$abc = "hello http://www.google.com is a good search engine";
</code></pre>

<p>What i need to do is move the string <code>'http://www.google.com'</code> to the end of the string, so the output would be like this:</p>

<pre><code>$abc2 = "hello is a good search engine http://www.google.com";
</code></pre>

<p>I have already written regex: <code>@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?\.(gif|png|jpe?g))@</code> and the <code>preg_match</code> for it:</p>

<pre><code>preg_match('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?\.(gif|png|jpe?g))@', $str);
</code></pre>
