|
Posted by RageARC on 09/27/07 20:13
On 27 Sep, 20:58, JackpipE <pipe.j...@gmail.com> wrote:
> I need to create multidimensional array with arrays inside of it.
>
> database
>
> name | value1 | value2
> john | red | 45
> john | red | 56
> john | yellow | 11
> mike | blue | 23
> mike | black | 41
>
> I would like to get this in this array format:
> Array ([john] => Array( [0]=>red [1]=>red [2]=>yellow) Array( [0]=>45
> [1]=>56 [2]=>11))
>
> The idea as you can see is to have value1 and value2 as separate array
> within the name array.
>
> Thanks,
> Jack
$array = array(
'john' => array('VALUE1' => 'red', 'VALUE2' => '45'),
[...]
);
usage example:
print $array['JOHN']['VALUE1']; // Outputs red.
Navigation:
[Reply to this message]
|