public static function encode(String $string) : String
    {
        $secBadChars = Properties::$injectionBadChars;

        if( ! empty($secBadChars) )
        {
            foreach( $secBadChars as $badChar => $changeChar )
            {
                if( is_numeric($badChar) )
                {
                    $badChar = $changeChar;
                    $changeChar = '';
                }

                $badChar = trim($badChar, '/');
                $string  = preg_replace('/'.$badChar.'/xi', $changeChar, $string);
            }
        }

        return addslashes(trim($string));
    }
public static function encode(String $string) : String
    {
        $secBadChars = Properties::$injectionBadChars;

        if( ! empty($secBadChars) )
        {
            foreach( $secBadChars as $badChar => $changeChar )
            {
                if( is_numeric($badChar) )
                {
                    $badChar = $changeChar;
                    $changeChar = '';
                }

                $badChar = trim($badChar, '/');
                $string  = preg_replace('/'.$badChar.'/xi', $changeChar, $string);
            }
        }

        return addslashes(trim($string));
    }
public static function encode ( String $ string ) : String { $ secBadChars = Properties :: $ injectionBadChars ; if ( ! empty ( $ secBadChars ) ) { foreach ( $ secBadChars as $ badChar => $ changeChar ) { if ( is_numeric ( $ badChar ) ) { $ badChar = $ changeChar ; $ changeChar = '' ; } $ badChar = trim ( $ badChar , '/' ) ; $ string = preg_replace ( '/' . $ badChar . '/xi' , $ changeChar , $ string ) ; } } return addslashes ( trim ( $ string ) ) ; }
Encode Injection Chars

@param string $string

@return string
Encode Injection Chars