How to change an array

DesignWork - April 28, 2008 - 00:17

Hi all,

I have a small problem i hav an array like this: Array ( [0] => Company Group [1] => My golden dreams [2] => Testgroup Closed [3] => testgroup Invite )

But I want it only like this Company Group, My golden dreams, Testgroup Closed, testgroup Invite.

How can I do this?

Warm regards from cologne

Dirk

You are using print_r();

zeta ζ - April 28, 2008 - 01:21

Instead use:

<?php
foreach ($My_array as $field) {
  print
$field . ', ';
}
?>

___________________
It’s in the detaιls…

demonstration portfolio

solved

DesignWork - April 28, 2008 - 06:57

Hi zeta,

thanks for the reply. I solved my problem. I need the array for a from type select. So I just changed the array key to something more use full for me.

Dirk

 
 

Drupal is a registered trademark of Dries Buytaert.