Thanks but it didnt work, so instead I did this:
Seems to work fine.
$link = "<a href=\"http://www.google.com/url?q=$fullurl\" target=\"_blank\">$name</a>";
Seems to work fine.