Path: csiph.com!usenet.pasdenom.info!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: detection of 2d array? Date: Fri, 25 Oct 2013 00:10:29 +0200 Lines: 22 Message-ID: References: <7x8n4ftkdpt.13nclqr4ren29.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net yGBlfFXk4hc+gq8t2QtAEwNqrPRQ8zJkd/pQQkT+kdG4De05Z8 Cancel-Lock: sha1:5+/UYdj3XEq77OGLgS/dw85+rTw= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <7x8n4ftkdpt.13nclqr4ren29.dlg@40tude.net> Xref: csiph.com comp.lang.php:11579 On 24/10/13 23:39, richard wrote: > given the example>>> > > array=("item","photo"), > array=("item",array=("photo1","photo2")), > array=("item","photo") > > Is there any way of knowing when an array item has a subarray item? > is_array() shoulr be able to tell you if a variable is an array $array=array("item", array("photo1","photo2")); foreach($array as $key => $cell) if(is_array($cell)) echo "cell {$key} has an array\n"; see http://www.php.net/manual/en/function.is-array.php -- //Aho