Page 1 of 1

Arrays inside of arrays

Posted: Sun Jun 22, 2008 8:23 pm
by elHelgo
I am using a calendar script, and the example places static code for the days of the month that link to certain pages:

Code: Select all

<?php
    $days = array(
        2=>array('#','linked-day'),
        3=>array('#','linked-day'),
        8=>array('#','linked-day'),
        22=>array('#','linked-day'),
    );
    echo generate_calendar(2008, 6, $days, 3, '#');
?>
I am new to nested arrays, and was wondering how I can populate the $days array when pulling from a database filled with values. In my database, I have a table for these days and have the values 'day' and 'link' stored in it. I have no problem pulling values from the database, I am just uncertain about how to populate the $days array example above, only dynamically from the MySQL database.

Any help is greatly appreciated.

Thanks,
elHelgo