Replace prime with quote [' to "]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arjunetal
Forum Newbie
Posts: 2
Joined: Tue Dec 16, 2008 12:07 pm

Replace prime with quote [' to "]

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Replace prime with quote [' to "]

Post 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?
msurabbott
Forum Commoner
Posts: 33
Joined: Thu Jan 01, 2009 10:18 pm
Location: Chicago, IL, USA

Re: Replace prime with quote [' to "]

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Replace prime with quote [' to "]

Post by John Cartwright »

I would say str_replace is the best option.
Post Reply