mettendo che il link sia
testo link

il codice sarà
Codice PHP:
<?php

$str 
'[url="http://google.com"]testo link[/url]';
$str str_replace('<a href="''' ,$str); // elimina <a href="
$str substr($str,0,strpos($str,'">')); // elimina tutto ciò che c'è dopo il "> dopo google.com 
echo $str//stampa [url]http://google.com[/url]
?>
se invece ciò da cui devi prendere l'url è
<div>testo link</div>
sostituisci la seconda riga
Codice PHP:
$str str_replace('<a href="''' ,$str); 
con
Codice PHP:
$str str_replace('<div><a href="''' ,$str);