Page 1 of 1

Replace prime with quote [' to "]

Posted: Sun Jan 04, 2009 4:41 am
by arjunetal
Hello,
Can anyone tell me how can replace prime symbol (') with quote symbol ("), using str_replace function or any other such function.

Thanks in advance.

Re: Replace prime with quote [' to "]

Posted: Sun Jan 04, 2009 5:03 am
by requinix
arjunetal wrote:Hello,
Can anyone tell me how can replace prime symbol (') with quote symbol ("), using str_replace function or any other such function.

Thanks in advance.
You already know what function to use. How can you possibly not be able to figure it out for yourself?

Re: Replace prime with quote [' to "]

Posted: Sun Jan 04, 2009 11:42 am
by msurabbott
From php.net

mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )

$search => searching for what
$replace => replace with what
$subject => string to replace characters on.

You may want to do some research on best practices and php optimization though as I'm not sure str_replace is the fastest option for something of this sort.

Re: Replace prime with quote [' to "]

Posted: Sun Jan 04, 2009 12:03 pm
by John Cartwright
I would say str_replace is the best option.