<?php $nuevo = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES); echo $nuevo; // resultado: <a href='test'>Test</a> ?>