soluzione banale:
<textarea><?php echo($code);</textarea>

soluzione semibanale:



<?php echo(htmlentities($code)); ?>
</p>