Re: str_replace
| From: | LinuxManMikeC | Date: | Sat, 08 Aug 2009 10:19:11 +0000 |
| Subject: | Re: str_replace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296463@lists.php.net to get a copy of this message | ||
On Sat, Aug 8, 2009 at 2:08 AM, Ron Piggott<ron.php@actsministries.org> wrote:
> Am I understanding str_replace correctly? Do I have this correct or are ' needed?
>
> $bible_verse_ref is what I want to change to (AKA replace)
> bible_verse_ref is what I change to change from (AKA search)
> $text_message_template is the string I want to manipulate
>
> $text_message = str_replace( $bible_verse_ref, 'bible_verse_ref',
> $text_message_template );
>
> Ron
If I understand you right, I think you have the search and replace
arguments mixed up. Your current code will look for all occurrences
of $bible_verse_ref in $text_message_template and replace it with
'bible_verse_ref'.
http://us.php.net/manual/en/function.str-replace.php