FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » detection of 2d array?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: detection of 2d array? [message #183443 is a reply to message #183442] Thu, 24 October 2013 22:10 Go to previous messageGo to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: detecting a file in use
Next Topic: Mysqli or PDO Persistent prepared statements
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 04:11:46 GMT 2024

Total time taken to generate the page: 0.05309 seconds