|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
|
#1 |
|
macrumors newbie
Join Date: Dec 2005
Location: Canada
|
have a question about php
i don't have a mac but it seem like there was lots of help here.
this question is about php: i want to know how to get rid of the \ befor every '. now i will give you the situation: i have made it so my firend can update his news on his webpage throught the browser . i made it so he inputs the date and i writes it to a file and then he inputs the new news and then it writes to another file and then he puts in his sig and i puts in into a nother file. then he sends it. the files then are taken into seperate arrays, then i used the implode functio to change them to strings then i brought the old news into an array, then i used the array_unshift to add all the new information into the old news, then i used the implode function on that, then i wrote over the file with the new string i hade which included the old news and the new news. then the file is read into a seperate page when it comes up on the page if i hade "wasn't" it would come up as "wasn\'t". what can i do to stop that from happening? |
|
|
|
|
|
#2 |
|
macrumors 6502a
Join Date: Apr 2005
Location: Monterrey, México
|
Have you tried storing your ' as " ? Not sure that would work though, I've never used PHP, but I think it's something along those lines. Or use a replace function to get rid of them.
__________________
"He who will not reason is a bigot; he who cannot is a fool; and he who dares not is a slave."
|
|
|
|
|
|
#3 |
|
Thread Starter
macrumors newbie
Join Date: Dec 2005
Location: Canada
|
this is the main code im using
PHP Code:
this is the websight where i have it set up: http://members.lycos.co.uk/phpsight1101/ Last edited by Novark : Dec 20, 2005 at 02:28 PM. |
|
|
|
|
|
#4 |
|
macrumors 68030
Join Date: Nov 2003
|
stripslashes is your friend. You should also read about magic_quote on php.net it goes quote well with stripslashes and doing mysql work.
http://us3.php.net/manual/en/function.stripslashes.php PHP Code:
__________________
Cowzilla The Feed Monster |
|
|
|
|
|
#5 |
|
Thread Starter
macrumors newbie
Join Date: Dec 2005
Location: Canada
|
thanx
thank you soo much it works and it is my new friend
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|