You are here : phpstringaddslashes

addslashes() - string

Returns a string with backslashes before characters that need to be
   escaped. These characters are single quote ('),
   double quote ("), backslash
   () and NUL (the NULL byte).
Parameters :
  • str - The string to be escaped.

  • Syntax

    string addslashes
        ( string $str
       )


    Example

    <?php$str = "Is your name O'Reilly?";// Outputs: Is your name O'Reilly?echo addslashes($str);?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference