Ron Eggler @ work
Jun 24 2005, 04:33 AM
hi,
I got an array and want to build a string with it's elements, how do i do
it?
I tried:
while($j=0;j<=count($spamArray); j++)
{
$outStr[$j]="<option>".$spamArray[$j]."</option>"
}
but:
Parse error: parse error in /srv/www/htdocs/web2/html/php/nospam/pop.php on
line 32
Thank you! :)
Ron Eggler @ work
Jun 24 2005, 05:26 AM
Ron Eggler @ work wrote:
QUOTE |
hi,
I got an array and want to build a string with it's elements, how do i do it? I tried:
while($j=0;j<=count($spamArray); j++) { $outStr[$j]="<option>".$spamArray[$j]."</option>" }
but: Parse error: parse error in /srv/www/htdocs/web2/html/php/nospam/pop.php on line 32
Thank you! :)
|
haha forget about thinking about this snipppet, I'm sorry for thast post...
:(
Hugh
Jun 24 2005, 10:50 PM
Try
$string=implode(' ',$spamArray);
assuming spaces between array elements.
"Ron Eggler @ work" <[Email Removed]> wrote in message
news:[Email Removed]...
QUOTE |
hi,
I got an array and want to build a string with it's elements, how do i do it? I tried:
while($j=0;j<=count($spamArray); j++) { $outStr[$j]="<option>".$spamArray[$j]."</option>" }
but: Parse error: parse error in /srv/www/htdocs/web2/html/php/nospam/pop.php on line 32
Thank you! :)
|
Kimmo Laine
Jun 26 2005, 03:28 PM
"Ron Eggler @ work" <[Email Removed]> kirjoitti
viestiss:[Email Removed]...
QUOTE |
hi,
I got an array and want to build a string with it's elements, how do i do it? I tried:
while($j=0;j<=count($spamArray); j++) { $outStr[$j]="<option>".$spamArray[$j]."</option>" }
but: Parse error: parse error in /srv/www/htdocs/web2/html/php/nospam/pop.php on line 32
|
for($j=0;j<=count($spamArray); j++)
{
$outStr.="<option>".$spamArray[$j]."</option>";
}
--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears
[Email Removed]
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.