Welcome to WebmasterWorld Guest from 184.108.40.206
I have a problem with removing slashes which are added to my text in my php pages.
I have tried to add the stripslashes () function to every possible variable but nothing seems to remove the slashes. VAR5 is the text that is added to my pages. Can someone tell me what I'm doing wrong? Here is the code:
$var1 = strtolower($rslt1[$j][title]);
$var2 = ucfirst($var1);
$var3 = str_replace(" ","_",$var1);
$var4 = strtoupper($var3);
$var5 = stripslashes(str_replace("_"," ",$var4));
for ($l=0 ; $l<strlen($var5); $l++)
$le = $var5[$l];
if (@in_array($le, $special_char1))
foreach($upper_char as $key => $value)
$var5 = str_replace($key, $value, $var5);
$var5 = strtoupper($var5);
Thanks in advance
[edited by: Roolio at 5:08 pm (utc) on Oct. 23, 2007]
what is the value of $rslt1[$j] and how do you get this variable?
the case may be that you've accidently applied the mysql_real_escape_string() to this var, which is what happened to me.
I've checked the whole document and every variable that has a relation to rslt1[$j] but nowhere I could find the mysql_real_escape_string or anything other suspicious that could lead to the disfunctioning of stripslashes.
I guess that you dont need to answer the questions just check them all to see. As if stripslashes is working for something and not for other things then there must be something different in the set up or use.
Another thought - have you looked to see if there is a bug report for the version of php you are using and stripslashes? As it may be as suggested above that stripslashes is not working in combination with other functions.
Ok end of desperate attempt :) Hope some of it helps