Posted by Robin on 08/20/07 14:26
> "Captain Nemo" <regal_zonophoneSPAM@yahooSPAM.com> wrote in message
> news:v0hyi.9825$cw7.7926@text.news.blueyonder.co.uk...
> | I've been writing code lately that loops through the $_POST and
> | $_SESSION arrays and needs to determine if a particular member is a
> | scalar or an array.
> |
> | I've found a test that works:
> |
> | while (list($key, $value) = each($_POST))
> | {
> | if ((string) $value == "Array")
> | etc.
> |
> | but it really looks a bit tacky to me.
> |
> | Can anyone suggest something a bit more respectable?
> |
> | Thanks.
> |
Steve wrote:
> is_array($value)
>
Also, instead of that while statement why not use the cleaner (looking
at least):
foreach ($_POST as $key=>$value)
Robin
Navigation:
[Reply to this message]
|