← All docs

addslashes()

Adds backslashes before characters that need to be escaped.

addslashes()

function addslashes(string $string): string

Adds backslashes before characters that need to be escaped.

Parameters:

  • $string (string)

Returns: string

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how addslashes is implemented in the compiler, see the internals page.