<?php
function color($string){
    $string = str_replace("&lt;/","<font color='blue'>&lt;/</font>",$string);
    $string = str_replace("/&gt;","<font color='blue'>/&gt;</font>",$string);
    $string = str_replace("&lt;","<font color='blue'>&lt;</font>",$string);
    $string = str_replace("&gt;","<font color='blue'>&gt;</font>",$string);
    $string = str_replace("xhtml","<font color='forestgreen'>xhtml</font>",$string);
    $string = str_replace("html","<font color='forestgreen'>html</font>",$string);
    return nl2br($string);
    }

echo "<div align='".$_GET['alinhamento']."'><font face='verdana' size=2>";

if(isset($_GET['url']) and isset($_GET['alinhamento']) and $_GET['url'] != "http://"){
foreach(file($_GET['url']) as $linha => $valor){
$conteudo = htmlspecialchars($valor);
echo color($conteudo);
} }

else{
?>
<body onload='document.forms[0].url.focus()'>
<center><form action='fonte.php' method='get'>
Url: <input type='text' name='url' value='http://'> <input type='submit' value='Ver Fonte' style='border 0px;color: black;'><br><br>
<input type='radio' name='alinhamento' value='left'>Esquerda
<input type='radio' name='alinhamento' value='center' checked>Centro
<input type='radio' name='alinhamento' value='right'>Direita
</form>

<? } ?>