i dont know if there is such a function
that would fit your exact case
but you could make your own custom replace/remove
using [man]preg_replace[/man]
only you know what your data is like and how you would want it 'cleaned up'
'white spaces' I know what it is - you want to remove all spaces?
this, as you know, will do it str_replace( ' ', '', $data );
'rubbish formating' can mean almost anything
🙂