brackets []
| From: | Craig Hoffman | Date: | Tue, 25 Jan 2005 15:38:46 +0000 |
| Subject: | brackets [] | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-38319@lists.php.net to get a copy of this message | ||
Quick question...
I am hoping some could explain this to me. I have an array like this:
$completed = array($value1, $value2, $value3);
where the values are sent via a form.
<input type="checkbox" name="completed[]" value="value1">
when I do print_ r() to see what's in the array I get this:
Array ( [0] => [1] => [2] => )
An empty array. But when I do this:
$completed[] = array($value1, $value2, $value3);
Array ( [0] => 1 [1] => 1 [2] => Done [3] => 2 [4] => 1 [5] => 3 [6] => 1 [7] => 4 [8] => 1 [9] => Array ( [0] => [1] => [2] => ) )
I get a multidimensional array with keys and values. How can I get this array to be one dimensional?
Much Thanks - CH