post - Error imploding $_POST[] array containing php variable -


I'm trying to penetrate an array into $ _POST [] I'm doing this inside a loop Searches for values ​​in ~ 31 arrays ... $ _ POST ['1'], $ _POST ['2'], $ _POST ['3'], etc.

I am trying to do this:

  while ($ i & lt; = $ _SESSION ['day inmon']) {$ month = $ _SESSION [ 'Month']; $ Day = $ i; $ Names = implode (',', $ _ POST ['names _'. $ I]); $ Area = $ _SESSION ['region']; $ Date = date ("Y"). '-'. $ Month. '-' $ Day; Echo ("$ name"); $ I ++;  

/home/content/r/e/s/reslife4/html/duty/schedule.php on line 15

In this way, I can get $ _POST [ ] Creating variable:

   

Can anyone see what I'm doing?

Thank you!

If you pass in the form of second argument to pass someone other than the array ( If no option is selected), then you will get a warning. You can either enter conditionally:

  if (empty ($ _ POST ['names_'. $ I])) // implode  
< P> or cast array:

  $ names = implode (',', (array) $ _ POST ['name_'. $ I]);  

Comments