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,delega tebname
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 ? 3 21951
"Syl" <da**********@gmail.com> wrote in message
news:11**********************@x69g2000cwx.googlegr oups.com... 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,delega tebname
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
ED wrote: "Syl" <da**********@gmail.com> wrote in message news:11**********************@x69g2000cwx.googlegr oups.com... 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,delega tebname
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!
"Syl" <da**********@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com... ED wrote: "Syl" <da**********@gmail.com> wrote in message news:11**********************@x69g2000cwx.googlegr oups.com... > 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,delega tebname > > 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!
:) no prob! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: K.Simon |
last post by:
Hello,
it's very often neccessary to replace strings or a single character in
my stylesheets. My solution looks awful and very long. Now i thought
to solve this with an array like structure but...
|
by: Billy N. Patton |
last post by:
-------- Original Message --------
Subject: <string>.replace
Date: Fri, 15 Oct 2004 11:07:19 -0500
From: Billy N. Patton <b-patton@ti.com>
Organization: Texas Instruments
Newsgroups:...
|
by: Eric Lilja |
last post by:
Hello, I had what I thought was normal text-file and I needed to locate a
string matching a certain pattern in that file and, if found, replace that
string. I thought this would be simple but I had...
|
by: Paul |
last post by:
hi, there,
for example,
char *mystr="##this is##a examp#le";
I want to replace all the "##" in mystr with "****". How can I do this?
I checked all the string functions in C, but did not...
|
by: Mahesha |
last post by:
Hello,
I need help in replacing one string pattern with another.
Ex: I have a financial security expression like
log(T 3.25 6/24/2004)/sqrt(T 4.5 6/19/2002)
Here "T 3.25 6/24/2004" is a...
|
by: Etu |
last post by:
Hi,
I have a string:
string c = "'abc' \"cde\", 'mno' \"xyz\",";
how can I use the c.Replace(???, ???) method to have this string:
"'abc' "cde", 'mno' "xyz","
that is, all the...
|
by: Craig Buchanan |
last post by:
Is there a way to combine these two Replace into a single line?
Regex.Replace(Subject, "\&", "&")
Regex.Replace(Subject, "\'", "'")
Perhaps Regex.Replace(Subject, "{\&|\'}", "{&|'}")...
|
by: serge |
last post by:
I managed to put together C# code and have it
do the following:
1- Get all the table names that start with the letter "Z"
from sysobjects of my SQL 2000 database and put
these table names...
|
by: kilik3000 |
last post by:
How do you do a global replace in a string without using a regex?
For example,
"ABBA".replace("B", "") returns -"ABA" // I'd like this to be a
global replace
"ABBA".replace(/B/g, "") ...
|
by: Lonifasiko |
last post by:
Hi,
Just want to replace character at index 1 of a string with another
character. Just want to replace character at that position. I thought
Replace method would be overloaded with an index...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |