$html = "Hello world!
"; $sanitizedHTML = OC_Util::sanitizeHTML($html); echo $sanitizedHTML; // outputs "Hello world!
"
In both examples, we are using the sanitizeHTML function to remove any potentially dangerous HTML code from the input. The OC_Util library is part of the ownCloud project, which is a free software package for online file storage and collaboration.