Jump to content

PHP Foreach


AE117

Recommended Posts

The title makes it sound easy but here is what I am trying to accomplish.

 

I have a form where there is  a text feild with the name="name[]"

 

Now I setup a simple foreach

 

foreach ($_POST[name] as $value)

{

code to ex

}

 

Now this works as it gives me the value of the field. I ran into a wall trying to pull not only the value of the field but the id as well.

 

So now lets say the field is as

 

name="name[]" id ="Dynamic from PHP" value = "Dymnamic from php"

 

With a, foreach, is it possible to get both the value as well as the id value?

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/184966-php-foreach/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.