Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Convert binary data into hexadecimal representation
<?php bin2hex(string $string): string
<?php     protected function escapeBinary($value)

    {

        $hex = bin2hex($value);



        return "x'{$hex}'";

    }
<?php     protected function escapeBinary($value)

    {

        $hex = bin2hex($value);



        return "'\x{$hex}'::bytea";

    }
<?php     protected function escapeBinary($value)

    {

        $hex = bin2hex($value);



        return "x'{$hex}'";

    }
<?php     protected function escapeBinary($value)

    {

        $hex = bin2hex($value);



        return "0x{$hex}";

    }