Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11579

Re: detection of 2d array?

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" <user@example.net>
Newsgroups comp.lang.php
Subject Re: detection of 2d array?
Date Fri, 25 Oct 2013 00:10:29 +0200
Lines 22
Message-ID <bctk6lFrenvU1@mid.individual.net> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

detection of 2d array? richard <noreply@example.com> - 2013-10-24 17:39 -0400
  Re: detection of 2d array? "J.O. Aho" <user@example.net> - 2013-10-25 00:10 +0200
    Re: detection of 2d array? richard <noreply@example.com> - 2013-10-24 18:12 -0400
  Re: detection of 2d array? Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-25 14:58 +0000
    Re: detection of 2d array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-26 02:37 +0200
  Re: detection of 2d array? Struchkov Vladimir <struchkov@gmail.com> - 2013-11-06 05:24 -0800
    Re: detection of 2d array? Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-06 17:04 -0500

csiph-web