1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.
In PHP you can use the str_replace () function to find and replace information within a string. You can search within a single piece of data or within an entire array. Your search and replacement strings can also consist of either a single entry, or an array of data.
Comments
July 18, 2007 at 11:18 pm
(1) cj says:

you need to put some examples on there.

December 21, 2007 at 5:19 pm
(2) luke smith says:

is this supposed to help?!

July 3, 2008 at 7:43 am
(3) Henk says:

maybe you should click on the function ;-)

August 30, 2008 at 8:02 pm
(4) teedot says:

this is useless to anyone without any examples.

September 25, 2008 at 6:57 am
(5) S-fin says:

This is useless to anyone too stupid to click on the link…

January 21, 2009 at 5:33 pm
(6) Anonymous says:

Leave it up to a woman so-called “programmer” to not have an example. Sorry guys.

January 23, 2009 at 2:24 pm
(7) php says:

Wow, sexist… nice!

Click the link bright boy….

June 1, 2009 at 6:07 pm
(8) php person thanks in part to your lessons says:

Angela –

I always appreciate your posts – very clear explanations with GOOD EXAMPLES!

Thanks!

January 25, 2010 at 11:08 pm
(9) Dave says:

Bloody women! What rubbish!

August 8, 2010 at 3:32 pm
(10) eugene says:

@Dave @S-fin @Anonymou

there is a link you stupid idiots

leave it up to stupid men for stupid comments!

October 18, 2010 at 6:09 am
(11) Mubarak says:

Hi Angela ,

I am beginner for php.

i want replace the text like below

$string =”PHP is FREE to download from the official php resource”;

if the word “php” exist ,

1. “php” text will relpace as “php
2.Also “PHP” text wil replace as “PHP

is it possible?

June 26, 2012 at 9:20 am
(12) Alfred Tanya says:

Good explanation!

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.