Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #11579
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: detection of 2d array? |
| Date | 2013-10-25 00:10 +0200 |
| Message-ID | <bctk6lFrenvU1@mid.individual.net> (permalink) |
| References | <7x8n4ftkdpt.13nclqr4ren29.dlg@40tude.net> |
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
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