Hi everybody
I'm pulling an array out of my DB using mysql_fetch_array($query) and want to get rid of any slashes. I tried using stripslashes() on the result, but got an error message. I have read the following thread: http://www.phpbuilder.com/board/showthread.php?s=&threadid=10243694&highlight=stripslashes and checked the manual for stripslashes(), but am still a little unsure. Anyone got any advice for me?
$result = mysql_fetch_array($query); $noslash_result = stripslashes($result); // Attmepts to use $noslash_result lead to error (unidentified variable)
Thanks for your help
Norm
You cant use stripslashes() on an array.
You have to loop through the array and apply the function to each individual scalar element.
Thanks Laserlight
That's what I figured, but I didn't want to write excessive amounts of code if there was an elegant shortcut.
I'll go right ahead and do that.
Cheers