I'm trying to get the users from PHP form. PHP Function has to create new users (username, first name & email) with registeruser($user),that is to insert to database.
I was able to insert only one row to database. Could you guide me to insert more than one user and return all the users.
The new users come from $array['newuser'].
function newusers() {
foreach($array['newuser'] as $row) {
$user = new stdClass();
$user->username = $row['username'];
$user->firstname = $row['firstname'];
$user->email = $row['email'];
$userreg = registeruser($user);
return array($userreg)
}
}
$userreg[] =registeruser($user);andreturnthat array after the loop$userreg