src/DataHandling.php
public static function sanitizeString($string)
    {
        if (!$string) {
            return null;
        }

        // Remove linebreaks and HTML tags
        $string = str_ireplace(["\r\n", "\n", "\r"], " ", $string);
        $string = html_entity_decode($string, ENT_NOQUOTES, "UTF-8");
        $string = trim(strip_tags($string));

        if (!$string) {
            return null;
        }

        return (string)$string;
    }
public static function sanitizeString($string)
    {
        if (!$string) {
            return null;
        }

        // Remove linebreaks and HTML tags
        $string = str_ireplace(["\r\n", "\n", "\r"], " ", $string);
        $string = html_entity_decode($string, ENT_NOQUOTES, "UTF-8");
        $string = trim(strip_tags($string));

        if (!$string) {
            return null;
        }

        return (string)$string;
    }
public static function sanitizeString ( $ string ) { if ( ! $ string ) { return null ; } // Remove linebreaks and HTML tags $ string = str_ireplace ( [ "\r\n" , "\n" , "\r" ] , " " , $ string ) ; $ string = html_entity_decode ( $ string , ENT_NOQUOTES , "UTF-8" ) ; $ string = trim ( strip_tags ( $ string ) ) ; if ( ! $ string ) { return null ; } return ( string ) $ string ; }
Trims string, removes tags and linebreaks.
Returns null if string equals false, before or after conversion.

@param $string
@return string|null
Trims string removes tags and linebreaks . Returns null if string equals false before or after conversion .