0

Hi i'm trying to create a new array in a php function from a foreach loop but what i'm doing isn't working... any advise please :)

$data = array(
  'action' => 'add',
  'send_confirmation' => true,
  'signups' => array(
  foreach ($signups as $signup) {
    array(
      'first_name' => $signup['first_name'],
      'last_name' => $signup['last_name'],
      'email' => $signup['email'],
      'mobile' => $signup['mobile'],
      'ticket_id' => $signup['ticket_id']
    ),
  }
  )
);
2
  • What does $signups look like? You may not even need a loop. Commented May 13, 2016 at 15:43
  • 1
    WOW! The dupe is eerily similar! Commented May 13, 2016 at 15:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.