Codice PHP:
$cosa=array("<",">");
$come=array("&lt;","&gt;");
echo 
"<input ... value=".str_replace($cosa,$come,$result['titolo']).">"