Need to store values from foreach loop into an array, need help doing that.
The code below does not work, only stores the last value, tried $items .= ...,
$items .= ...,
$items=array(); $j=0; foreach($group_membership as $i => $username){ $items[$j++]=$username; }
Just try the above in your code .
<?php $items = array(); $count = 0; foreach($group_membership as $i => $username) { $items[$count++] = $username; } print_r($items); ?>