Don't use echo
... use becho
!
composer install rezen/becho
In your app, wherever you init and configure things, add a wrapper
<?php
// Basic example
becho("Some yellow text", ['color' => BECHO_YELLOW]);
// Or if you are not using a templating engine, you can echo safely
?>
<input type="text" value="<?php becho($value, BECHO_ESC_ATTR); ?>" />