carichi il testo che recuperi con fget in una variabile $testo

dopodichè puoi fare un str_replace