By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,636 Members | 2,334 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,636 IT Pros & Developers. It's quick & easy.

Replace value in a string

P: n/a
Hi !
I want to replace 'xxx' with '12' (for example) in a string $chaine. How can I do ?
Thanks for your answers
Eric
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I noticed that Message-ID:
<ac**************************@posting.google.com > from Eric contained
the following:
I want to replace 'xxx' with '12' (for example) in a string $chaine. How can I do ?
Thanks for your answers


str_replace("xxx","12",$chaine)

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2

P: n/a
Geoff Berrow wrote:
Eric
I want to replace 'xxx' with '12' (for example) in a string $chaine. How can I do ?


str_replace("xxx","12",$chaine)


better make that an assignment:

$chaine = str_replace('xxx', '12', $chaine);

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Jul 17 '05 #3

P: n/a
Eric wrote:
Hi !
I want to replace 'xxx' with '12' (for example) in a string $chaine. How
can I do ? Thanks for your answers
Eric

try phpdoc. there you will find that you can do that with
$chaine=str_replace("xxx", "12", $chaine)

--
==============
Peter Tselios
Jul 17 '05 #4

P: n/a
I noticed that Message-ID:
<bn*************@ID-203069.news.uni-berlin.de> from Pedro contained the
following:
better make that an assignment:


Got leave him something to do. ;-)

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #5

P: n/a
Carved in mystic runes upon the very living rock, the last words of Eric
of comp.lang.php make plain:
I want to replace 'xxx' with '12' (for example) in a string $chaine.
How can I do ? Thanks for your answers


http://www.altgeek.org/methuselah/rtfm/

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.