English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP slashes() function usage and example

    PHP String 字符串函数手册

   The slashes() function is used to remove addslashes() Backslashes added by the function.

Syntax

string stripslashes ( string $str )

Definition and usage

Returns the string with backslashes removed.

Return value

 Returns a string with escape backslashes removed (\' is converted to ' etc.). Double backslashes (\\) are converted to a single backslash (\).

Parameter

Serial numberParameters and descriptions
1

str

Used for string search

Online example

Try the following example, remove backslashes from the string:

<?php
//Remove backslashes from the string:
$str = "Is your name O\'reilly?";
// Output: Is your name O'reilly?
echo stripslashes($str);
?>
Test and see‹/›

Output result

 Is your name O'reilly?

PHP String 字符串函数手册