Ok, so I'm learning PHP (and quite enjoying myself so far).
I'm making a web page that will have a list of text boxes for the user to type info in. The boxes will be created dynamically via JavaScript (later on in development), and the id/name of the box will be equal to a php array (called label[]). There could be any amount of boxes.
For the problem, I've got an example HTML file that represents the problem:
<html>
<body>
<form action="test.php" method="post">
<input type="text" name="label[]" /><br />
<input type="text" name="label[]" /><br />
<input type="text" name="label[]" /><br />
<input type="submit" value="submit" />
</form>
</body>
</html>
And of course, here's the test.php file:
<?php
print_r($_POST);
?>
Rather simple, right? If I type 3 names in, and press submit, here's what I get:
Array(
[label] => Array(
[0] => bob
[1] => william
[2] => andy
)
)
I need to extract the array label out of $_POST, and then I need to find out how many items it has in it so I can get the information I need. Remember, there could be any amount label[] entries in the array.
Any help would be greatly appreciated!! :)