...

View Full Version : help replacing 's in a product title?



LJackson
02-21-2010, 08:28 PM
Hi All,

i am pulling data from a product feed and one of the titles im pulling out has the title of:


Roary The Racing Car: Roary's First Day

but when i insert it into my db it stores it as


's instead of the '

but im having trouble using str_replace to remove the ' by trying

$keywords = str_replace("/'|´","",$keywords);

but no matter what i try it never removes it

anyone have any ideas please?

thanks
Luke

MattF
02-21-2010, 08:45 PM
That single quote has been encoded by either htmlspecialchars or htmlentities. If you want it to appear in unencoded form, stop encoding your input.

LJackson
02-21-2010, 09:07 PM
hi mate, im defo not encoding it, i think it must of been encoded prior to the merchant adding it to the feed,

ive tried adding htmlspecialchars_decode to the varible value but im still getting the same problem?

any other ideas
cheers

MattF
02-21-2010, 09:13 PM
$keywords = str_replace("&#39 ;", "'", $keywords);


Without the space before the semicolon.

LJackson
02-21-2010, 09:23 PM
thanks mate :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum