Image

Imagematthias382 wrote in Imagephp 😟anxious

Listens: Jamie O'Neal - There Is No Arizona

Array Question

Hey all. I ran into an interesting problem that I thought I'd share to see if anyone's seeing something I'm not. I just installed PHP 4.3.0 (on a Windows XP box with IIS 5) and I'm working on a script that utilizes (through 'require') a configuration file, where all options are saved into an associative array called $cfg. One of the options is an array of items, assigned like so:

$cfg['foo'] = array("an item","another item","and so on");

I've put statements right after declaring this statement trying to display its contents, only to get a blank page. I've tried 'print_r', 'count', a 'list'/'each' loop that uses 'echo' to output the items... nothing seems to get it to display or show any signs of existence. Have I made some sort of mistake in declaring the array? I can't find an example in the user forums that uses this format.