Función para exportar campo sin tags HTML y listo para CSV

function usr_csv2striptags ($columns, $col, $param) {
# para exportar campo a csv

$text = $columns[$col][0][value];

return (strcspn($text,",\"\n\r") == strlen($text)) ? strip_tags($text) : '"'.str_replace('"', '""', str_replace("\r\n", "\n", strip_tags($text))).'"';
}

=====