note 66809 added to function.is-array
| From: | jupiter at nospam dot com | Date: | Tue, 30 May 2006 04:15:08 +0000 |
| Subject: | note 66809 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-112523@lists.php.net to get a copy of this message | ||
Simple check for a Multi-Dimentional Array of any depth
<?php
// checks for multiarray (2 or more levels deep)
function isMultiArray($multiarray) {
if (is_array($multiarray)) { // confirms array
foreach ($multiarray as $array) { // goes one level deeper
if (is_array($array)) { // is subarray an array
return true; // return will stop function
} // end 2nd check
} // end loop
} // end 1st check
return false; // not a multiarray if this far
}
?>
----
Server IP: 66.163.161.117
Probable Submitter: 68.104.56.193
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.is-array.php
Edit -- http://master.php.net/note/edit/66809
Del: integrated -- http://master.php.net/note/delete/66809/integrated
Del: useless -- http://master.php.net/note/delete/66809/useless
Del: bad code -- http://master.php.net/note/delete/66809/bad+code
Del: spam -- http://master.php.net/note/delete/66809/spam
Del: non-english -- http://master.php.net/note/delete/66809/non-english
Del: in docs -- http://master.php.net/note/delete/66809/in+docs
Del: other reasons-- http://master.php.net/note/delete/66809
Reject -- http://master.php.net/note/reject/66809
Search -- http://master.php.net/manage/user-notes.php