Getting a uniqe value in a link php not working
===

I have a string of text, which I then grab a URL from with php regex. There can be any number of links, so I'm using 
     
     preg_match_all

The problem is that for some reason when I put in one link, it's thinking that there are 3. When I do array unique it filters out the middle value, but not the last one. 

Here is the code below

     $bodyMessage = imap_body($hMail,$idxMsg);
     $bodyMessage = quoted_printable_decode($bodyMessage);

     preg_match_all('((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)', $bodyMessage, $matches, PREG_PATTERN_ORDER);
     $links = array_unique($matches[0]);
     print_r($links); 

The output of print_r($links) is:
     
     Array ( [0] => http://usnews.msnbc.msn.com/_news/2012/07/20/12861792-6-year-old-girl-confirmed-to-have-been-killed-in-colorado-theater-shootings?lite 
     [2] => http://usnews.msnbc.msn.com/_news/2012/07/20/12861792-6-year-old-girl-confirmed-to-have-been-killed-in-colorado-theater-shootings?lite

The body of the email that it parses is:
     
     --20cf300e4d7d02c34004c55e1489 Content-Type: text/plain; charset=ISO-8859-1 @bill http://usnews.msnbc.msn.com/_news/2012/07/20/12861792-6-year-old-girl-confirmed-to-have-been-killed-in-colorado-theater-shootings?lite --20cf300e4d7d02c34004c55e1489 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable @bill 

Any ideas?
Thanks!