Page 1 of 1

Mind Went To Hell...Array Question

Posted: Tue Jan 27, 2004 10:06 pm
by partiallynothing
I don't know why I am having so much trouble...

I create an array, say

Code: Select all

<?php $this = array ('This' => 'This', 'That' => 'That') ?>
and then later I want to add to the array. Just doing

Code: Select all

<?php $this = array ('this2' => 'this2') ?>
erases the first array. How do you add to an array. Thanks!

Re: Mind Went To Hell...Array Question

Posted: Tue Jan 27, 2004 10:13 pm
by jaxn

Code: Select all

<?php $this['this2'] = 'this2'; ?>



Only use array() when you are first creating the array.

-Jackson