Which gives out the output:
Tesing arrays:
ryan1,
ryan1.2,
ryan2,
ryan2.1.1.1.1.1,
ryan3,
ryan3.2,
my question/problem is simply this: how do i stop the last comma from
coming?
Hi,
See http://www.php.net/manual/en/function.implode.php
Pekka
http://photography-on-the.net/
--
PHP General
Try this:
?php
$a1[]=ryan1;
$a1[]=ryan1.2;
$a1[]=ryan2;
$a1[]=ryan2.1.1.1.1.1;
$a1[]=ryan3;
$a1[]=ryan3.2;
print(Tesing arrays:br);
for($i=0; $i count($a1); $i++) {
{
echo($a2[$i]);
if ($i != (count($a1) - 1)) {
echo ,br;
}
}
?
Matthew Walker
Senior
echo join (',br', $a1);
On Fri, 10 May 2002, r wrote:
Here is the code:
?php
$a1[]=ryan1;
$a1[]=ryan1.2;
$a1[]=ryan2;
$a1[]=ryan2.1.1.1.1.1;
$a1[]=ryan3;
$a1[]=ryan3.2;
reset($a1);
print(Tesing arrays:br);
while(list($aa1,$aa2) = each ($a1))
{
print($aa2 . ,br);
}
?
Which
3 matches
Mail list logo