Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Text Cleaner (See related posts)

// This function will remove unwanted stuff from submitted text.
// usage: $var = text_cleaner($str);


function text_cleaner($text){
        $text=str_replace("\"",""",$text); // Get rid of curly quotation marks
        $text=str_replace("  "," ",$text); // Get rid of double spaces (not tabs)
        $text=str_replace("\r","

",$text); //Windows files do \r\n, this is for a file created in Windows }

You need to create an account or log in to post comments to this site.


Related Posts