How to remove backslashes in php

藏色散人
Release: 2023-03-09 06:08:01
Original
3241 people have browsed it

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)
Copy after login

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?");
?>
Copy after login

Run result:

Who&#39;s Bill Gates?
Copy after login

[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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!