perhaps i'm misunderstanding you, but why not use a for loop?
for($i=0;$icount($array)-1;$i++){
echo $array[$i];
}
jack
-Original Message-
From: Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 18, 2001 10:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] re: array question
Jack-
Thanks for the response, but I don't want to echo the array, I want to
bundle it into a new variable that will be called as part of a str_replace.
The array is created from a loop through all the navigation items in a
database.
The code is below, if I echo the code is formatted in the
;
}
- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: Scott [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, September 18, 2001 7:29 PM
Subject: RE: [PHP] re: array question
perhaps i'm misunderstanding you, but why not use a for loop?
for($i=0;$icount($array)-1;$i++){
echo $array[$i
, 2001 7:29 PM
Subject: RE: [PHP] re: array question
perhaps i'm misunderstanding you, but why not use a for loop?
for($i=0;$icount($array)-1;$i++){
echo $array[$i];
}
jack
-Original Message-
From: Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 18, 2001 10
If you want to store all the values in the array in one variable (just as a
string with delimiters maybe?) Try this:
foreach ($array as $value) {
$temp .= $value . |;
}
Josh Hoover
KnowledgeStorm, Inc.
[EMAIL PROTECTED]
Searching for a new IT solution for your company? Need to improve
On Wed, 19 Sep 2001 12:28, Scott wrote:
That works, thank you, but it prints at the top of my page, is there
a way to store that array into a single variable?
Yes - implode()
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders
Thank YOU! It worked wonderful, I used a blank to separate the
content like this: $displn = implode(,$new_data);
Thank you again and thank you to everyone for helping me through this!
At 01:15 PM 9/19/2001 +0930, David Robley wrote:
On Wed, 19 Sep 2001 12:28, Scott wrote:
That works, thank
You wrote:
Also, consider using print or echo as opposed to printf. And lastly,
you
really don't need to use mysql_free_result, PHP does this
automagically
after the script dies. Sorry for picking on you, you may have your
reasons. ;-)
Really? Then why was it that, when I neglected to use
8 matches
Mail list logo