On Tuesday 25 January 2005 07:38 am, Craig Hoffman wrote:
> 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:

Are you sure it's empty? If the checkbox is checked, they should contain the 
value of that checkbox. That's my experience. 

> $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?

$completed = array($value1, $value2, $value3);

your other assignment line is basically saying, let the first array value 
equal another array of 3 values. 


HTH
-Micah

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to