1$items = array();
2foreach($group_membership as $username) {
3 $items[] = $username;
4}
5
6print_r($items);
1// array_push ( array &$array [, mixed $... ] ) : int
2// array_push() treats array as a stack, and pushes the passed variables onto the end of array. The length of array increases by the number of variables pushed. Has the same effect as:
3
4<?php
5$array[] = $var;
6?>
7// repeated for each passed value.
8// Note: If you use array_push() to add one element to the array, it's better to use $array[] = because in that way there is no overhead of calling a function.