public static function str_to_hex($string) {
        $hex = '';

        for ($i = 0; $i < strlen($string); $i++) {
            $hex .= dechex(ord($string[$i]));
        }

        return $hex;
    }
public static function str_to_hex($string) {
        $hex = '';

        for ($i = 0; $i < strlen($string); $i++) {
            $hex .= dechex(ord($string[$i]));
        }

        return $hex;
    }
public static function str_to_hex ( $ string ) { $ hex = '' ; for ( $ i = 0 ; $ i < strlen ( $ string ) ; $ i ++ ) { $ hex .= dechex ( ord ( $ string [ $ i ] ) ) ; } return $ hex ; }
Transform a strin to hexadecimal
@param  string $string string to convert
@return string hexadecimal string
Transform a strin to hexadecimal