note 81680 added to function.is-array
| From: | Amaroq at osu1 dot php dot net | Date: | Sun, 09 Mar 2008 18:36:12 +0000 |
| Subject: | note 81680 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136874@lists.php.net to get a copy of this message | ||
Even if an array has only one value, it is still an array and is treated like one.
<?php
$arr[] = "I'm an array.";
if(is_array($arr))
{
foreach($arr as $val)
{
echo $val;
}
}
?>
The above code outputs:
I'm an array.
----
Server IP: 208.69.120.35
Probable Submitter: 71.82.169.119
----
Manual Page -- http://www.php.net/manual/en/function.is-array.php
Edit -- https://master.php.net/note/edit/81680
Del: integrated -- https://master.php.net/note/delete/81680/integrated
Del: useless -- https://master.php.net/note/delete/81680/useless
Del: bad code -- https://master.php.net/note/delete/81680/bad+code
Del: spam -- https://master.php.net/note/delete/81680/spam
Del: non-english -- https://master.php.net/note/delete/81680/non-english
Del: in docs -- https://master.php.net/note/delete/81680/in+docs
Del: other reasons-- https://master.php.net/note/delete/81680
Reject -- https://master.php.net/note/reject/81680
Search -- https://master.php.net/manage/user-notes.php