Re: Replace a character in a string variable
- From: "Syl" <david.hunter@xxxxxxxxx>
- Date: 30 Jun 2006 08:09:58 -0700
ED wrote:
"Syl" <david.hunter@xxxxxxxxx> wrote in message
news:1151679331.062036.128540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi group -
I have a variable which is created from an input form.
After concatenating the input I want, I end up with a variable named
$all which looks like this :
delegatecountry,delegatefname,delegatelname,delegatebname
I want to take this string and replace all the commas with this :
</th><th>
So - I tried this :
$inside="</th><th>";
$newall = str_replace($inside, ",", $all);
But - it doesn't work.
http://ca3.php.net/str_replace
What am I doing wrong ?
First 2 parameters the wrong way round, should be:
$newall = str_replace(',', $inside, $all);
cheers
ED
DOH!
Thanks very much ED for the quick reply!
.
- Follow-Ups:
- References:
- Prev by Date: Re: Replace a character in a string variable
- Next by Date: Re: Replace a character in a string variable
- Previous by thread: Re: Replace a character in a string variable
- Next by thread: Re: Replace a character in a string variable
- Index(es):
Relevant Pages
|