Re: How to create an empty array

From: Date: Thu, 27 Feb 2003 18:04:08 +0000
Subject: Re: How to create an empty array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137447@lists.php.net to get a copy of this message
Use $category_list = array() instead. When you do $category_list[] = array(), you are creating an array of arrays. $category_list becomes an array with 1 element and this element is an empty array. So use $category_list = array(); "Michael Zornek" <mikezornek@mikezornek.com> wrote in message news:BA83B23C.2E17C%mikezornek@mikezornek.com... > I want to create an empty array so I can add elements to it later > > I'm currently using: > $catergory_list[] =array(); > > But when I try to print this list I discover the element zero has the string > "Array" in it. How can I create a truly empty array? > > ~ Mike > -- > MikeZornek.com > New blog, new Q&A column, new content everywhere! > http://www.mikezornek.com >

« previous php.general (#137447) next »