![]() |
stripslashes help
Got a small problem with a bit of code i am working on. I am reading a text file putting it to a temp file (the contents of it) then removing it to creat a fresh copy. Then i am adding the old content back and adding the new content to it also that was submited in the form, but the contents contain slashs which are messing up the page because the page reads the file and displays the contents in it.
I come out with this to strip the slashs but for some reason it wont work. PHP Code:
|
stripslashes is only for back slashes only to prevent quoted strings. But there is also other text replacement functions out there. my favorites are strtr and str_replace Plus in those functions you still need to save the results in a variable or they are not going to stay.
I would do it like this: PHP Code:
|
It is back slashes that are causing the problem, and although that what you put does work, i have a table in there and it is removing the close tag slash in there.
here is a bit of code of the result when i use my code just to show you. PHP Code:
|
Ok if it is just the back slashes that you want to get rid of, then you can use the stripslashes, like you've done. But you need to save the results of that call in a variable. Kind of like this:
PHP Code:
|
great stuff works how i need it to thanks :D
|
| All times are GMT. The time now is 11:00 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0