1. Home
  2. Computing & Technology
  3. PHP / MySQL

Stripslashes () PHP Function

By , About.com Guide

Definition: The function stripslashes is used to remove backslashes from data. One use for this function, is to display data to which addslashes has been applied. What this means is that stripslashes would change I\'m hungry into I'm hungry.
Also Known As: Strip Slashes, Remove Slashes
Examples:
<?php
$greeting = "Hello, I\'m Billy";
print stripslashes($greeting);
?>
This would output the string: Hello, I'm Billy
<?php
$said = 'Who said \"Live long and prosper\"?';
print stripslashes($said);
?>
This would output the string: Who said "Live long and prosper"?
Explore PHP / MySQL
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. Stripslashes - Strip Slashes - Stripslashes PHP

©2009 About.com, a part of The New York Times Company.

All rights reserved.