Reply
ereg_replace a backslash
Old 04-15-2008, 06:29 PM ereg_replace a backslash
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
Sorry for asking so many questions in this forum today

How can I ereg_replace a backslash? My script is outputting \" when it should be outputting "

Can I use ereg_replace to change \" to "

if so....how?

PHP Code:
$example ereg_replace('\"''"'$example
won't work
Gilligan is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-15-2008, 07:15 PM Re: ereg_replace a backslash
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Wireless Audio
Posts: 2,322
Name: Keith Marshall
Location: West Hartford, CT
$example = stripslashes($example);

PHP already thought of that, it's actually a product from PHP magic quotes that adds the slashes, but you can turn that off in the php.ini file.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 07:40 PM Re: ereg_replace a backslash
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
shared hosting..... so no option to do that.

Will this strip ALL slashes, or just backslashes??

because forward slashed I need...

EDIT

I now realize its backslashes only, thanks a lot, its working now. All these posts in the php forum has paid off, my script its pretty much working now.

Last edited by Gilligan : 04-15-2008 at 07:50 PM.
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 07:49 PM Re: ereg_replace a backslash
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Wireless Audio
Posts: 2,322
Name: Keith Marshall
Location: West Hartford, CT
Only backslashes \

PHP finally got smart and is disabling and removing magic quotes gpc in PHP 6

You might be able to disable this using htaccess flag:

php_flag magic_quotes_gpc off
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to ereg_replace a backslash
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12286 seconds with 12 queries