The stripslashes Function

The stripslashes function removes escaping of characters done by the addslashes function.

Syntax

phpstripslashes(string $string): string

Example

Let's use our function to remove the escaping of quotes:

php<?php
  echo stripslashes('id=\"eee\"');
?>

Code execution result:

php'id="eee"'

See Also

  • the addslashes function,
    which performs the reverse operation
  • the str_replace function,
    which also performs search and replace
  • the substr_replace function,
    which cuts out part of a string and replaces it with another