array_combine modification

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jjfletch
Forum Newbie
Posts: 13
Joined: Mon Apr 18, 2005 5:42 am

array_combine modification

Post by jjfletch »

When I print_r($_POST) to determine what's being posted from my form, I get this:

Code: Select all

Array ( [name] => Array ( [0] => Joe [1] => [2] => [3] => [4] => [5] => ) [animal] => Array ( [0] => Dog  [1] => Cat [2] => [3] => [4] => [5] => ) [submit] => Validez )
Then, I array_combine to (duh) combine the arrays, and I get this:

Code: Select all

Array ( [Joe] => Dog [] => )

I'd like to get this:

Code: Select all

Array ( [Joe] => Dog [] => Cat)
Anyone know how I can accomplish this?
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Maybe you should take a different approach in determining what's being posted to your script. What exactly did you need to know about the $_POST information, and what do you want to do with that information?
Post Reply