• Hi There,

    I’m having a hard time figuring this out, since I’m still a php newbe.

    For a custom Calendar widget I’m working on I need the php calendar to pull in the Dates from a custom field i’ve set up. So the Calendar requires the Dates with some other values in following format (manual version):

    $days = array(
    			"2"=>array($link,'class',$title),
    			"13"=>array($link,'class',$title),
    			"5"=>array($link,'class',$title)
    		    );

    So I would like to reproduce the same array string put together dynamically pulled in from the custom fields. I’ve come up with following solution inside a custom loop:

    $days = array( $day=>array($link,'class', $title));

    But I don’t get the same output if I print_r the array. Instead of receiving one array with values, I receive an array for each date. I’m thinking its got to do with the loop, and should rather use foreach, but I’m a bit lost how.

    Hope this rather difficult explanation is somewhat understandable. Looking forward to some input… regards

    Marcel

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Problem with Array and Loop for custom fields’ is closed to new replies.