I have an array setup like this:
How can I add another item to this array later?PHP Code:$CONFIG = Array(
thing => "thing",
thing2 => "thing2",
thing3 => "thing3");
Something like:
or something?PHP Code:$CONFIG[] = thing4 => "thing4";
Printable View
I have an array setup like this:
How can I add another item to this array later?PHP Code:$CONFIG = Array(
thing => "thing",
thing2 => "thing2",
thing3 => "thing3");
Something like:
or something?PHP Code:$CONFIG[] = thing4 => "thing4";
Try
PHP Code:array_push($CONFIG, "thing4");
Both will work if you change array_push($CONFIG, "thing4"); to
PHP Code:array_push($CONFIG, thing4 => "thing4");
cool, thanks :)
why not
$CONFIG[thing4] = "thing4";
unless the thing is dynamic then it would be
$CONFIG['$thing'] = "thing4";
Didn't know it would work that way. Thanks! :)Quote:
Originally posted by phpman
$CONFIG['$thing'] = "thing4";