- strip_tags: documentation ( source)
- trim: documentation ( source)
- html_entity_decode: documentation ( source)
- preg_replace: documentation ( source)
<?php
$txt = "sadigasidrasdy \r\n asibdasudas \r\n";
echo trim(preg_replace('/\r\n/','\r\n\t',strip_tags(html_entity_decode($txt))));