Questions tagged [stripslashes]

A PHP library function for un-quoting a quoted string or paraphrased stripping slashes from a string. Questions are about the workings or issues with the stripslashes function.

Un-quotes a quoted string. The function returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\) are made into a single backslash ().

Example (from PHP manual)

<?php
$str = "Is your name O\'reilly?";

// Outputs: Is your name O'reilly?
echo stripslashes($str);
?>

Links

108 questions
0
votes
2 answers

Stripslashes on PHP form

I have an HTML form which after it's submitted is supposed to present the form fields into a PHP file inside an echo statement (which also contains HTML elements) The problem I have is that while the results are produced as expected, on specific…
valdroni
  • 158
  • 3
  • 18
0
votes
1 answer

How to check and remove the additional back slash coming in account for for apostrophe in PHP?

I've a string in a variable titled $str as follows. This I got after converting it into JSON format. So the one more additional slash is added by JSON so please ignore it as it would not display while showing the string. $str…
user4661379
0
votes
2 answers

How to remove the additional(extra) backslashes present in HTML anchor tags?

I've following HTML string present in a variable titled $text: $text =
PHPLover
  • 1
  • 51
  • 158
  • 311
0
votes
0 answers

Why the extra slashes still coming even after using stripslashes and strip_tags on the string?

I've one string in a variable titled $message. After echo stripslashes(strip_tags($message)); I got following output. Michael Clarke commented on Darren Lehmann's status update "ߘðߘİߘ0ߘʢغ️" Now…
user4661379
0
votes
0 answers

stripslashes stripes protocol from POST

I've a simple php code were I like to get rid of slashes from a POST from a textarea with striplashes: $x = ''; echo 'X1: '.$x; $x = stripslashes($x); echo 'X2 : '.$x; The output is X1:
Xaver
  • 11,144
  • 13
  • 56
  • 91
0
votes
1 answer
0
votes
1 answer

How to remove my backslash while input have underscore

Problem when I enter any input which has underscore (_) data will store to my db looks like this image\_background.png Example $image = stripslashes($_POST['image']); // example image name image_background.png $query = 'UPDATE product SET image="'. …
wow
  • 7,989
  • 17
  • 53
  • 63
0
votes
1 answer

What is the right way to print escaped strings, and to hide backslashes on users end?

I'm building a website using Laravel 4. I'm using triple "{" while printing data from the database, or data that can be user manipulated but I have a dilemma here. When special characters are used they are escaped with a "\", but I don't want the…
igs013
  • 1,380
  • 10
  • 15
0
votes
2 answers

PHP such as stripslashes for forward slash?

Is there a similar option for removing forward slashes? I have a text input that could be any manner of slashes: e.g /slug/ or /slug or slug or slug/ I need to completely remove all forward slashes regardless of where they are. I know stripslashes…
Francesca
  • 26,842
  • 28
  • 90
  • 153
0
votes
1 answer

PHP Puzzler: finding the value of a variable's variable when the variable's value includes a slash

I've been puzzling over this for quite some time, and I'm hoping someone has an idea. Here's the code:
Ben in CA
  • 688
  • 8
  • 22
0
votes
2 answers

How to add striplashes onto my php mail script

customized my own mailing script. php newbie here so please bear with me. here's the code. I just want to add stripslashes onto the subject and the message, and if so wouldn't it remove also the slashes I made with \r\n\r\n? $headers="From:…
wolverene
  • 255
  • 1
  • 3
  • 11
0
votes
1 answer

Adding single quote into mysql results with \'s sometimes but not always

Initially when i try to add a string that have Single quotations the database used to return an error message.. So i added addslashes to that string before the query. After adding the addslashes, the String looks like this in DataBase. For some…
Ramaraju.d
  • 1,301
  • 6
  • 26
  • 46
0
votes
1 answer

php mailing function - get /'s in the mail

In my php project I am using php mail function. I have send test's as the content. But in my mail it look test\'s . How can I avoid this special character? I put nl2br function ... I also tried add slashes and stripslashes function. But that special…
Testadmin
  • 1
  • 1
0
votes
1 answer

Slashes appear in displayed form text despite using stripslashes

I have a comment box form up and running, and I just noticed that when I use ' it creates a \ in front of it. For example, if I write "how's" it shows up as "how\'s" both in the database it's posting to and when it displays on the page. I'm using …
coolpup
  • 159
  • 2
  • 14
0
votes
1 answer

What‘s meaning of stripslashes( $pass ) in php

When I was learing Brute Force in DVWA, I read the High Brute Force Source. It use stripslaches( $user ); function before use mysql_real_escape_string( $user ); function. I know mysql_real_escape_string() can escape special character so that it is…
JackSun
  • 1,418
  • 3
  • 15
  • 19