addcslashes

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Quote string with slashes in a C style
<?php addcslashes(string $string, string $characters): string
<?php         $value = str_replace("'", "''", $value);



        return "'" . addcslashes($value, "\000\n\r\\\032") . "'";

    }



    public function exec(string $sql): int
<?php     {

        return preg_replace(

            '~([' . preg_quote($this->getLikeWildcardCharacters() . $escapeChar, '~') . '])~u',

            addcslashes($escapeChar, '\\') . '$1',

            $inputString

        );

    }