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

02-21-2010, 07: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?


02-21-2010, 07: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.

02-21-2010, 08: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

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

Without the space before the semicolon.

02-21-2010, 08:23 PM
thanks mate :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum