Home  >  Article  >  Backend Development  >  How to remove backslashes in php

How to remove backslashes in php

藏色散人
藏色散人Original
2021-03-25 10:23:183257browse

How to remove backslashes in php: First create a PHP sample file; then delete the backslashes in the string through the "stripslashes("Who\'s Bill Gates?");" statement.

How to remove backslashes in php

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

stripslashes() function is deleted by addslashes() function. backslash.

Tip: This function can be used to clean data retrieved from the database or from an HTML form.

Syntax

stripslashes(string)

Parameters

string Required. Specifies the string to check.

Return value: Returns the string with backslashes stripped.

Example

Remove backslash:

<?php
echo stripslashes("Who\&#39;s Bill Gates?");
?>

Run result:

Who&#39;s Bill Gates?

[Recommended learning: PHP video Tutorial

The above is the detailed content of How to remove backslashes in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn