PHP - 检查是否$ _POST是数组? [英] php - check if $_POST is array?

查看:82
本文介绍了PHP - 检查是否$ _POST是数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这可能是一个愚蠢的问题,但我碰到的PHP code的片段,如果 $ _ POST is_array,办理入住手续()之前执行等功能。

I know this may be a silly question, but I come across a snippet of php code that check if the $_POST is_array() before execute other functions.

现在我想,$ _ POST应该总是关联数组或不?在此检查真正需要的?为什么?

Now I guess that $_POST should be always an associative array or not? is this check really needed? and why?

推荐答案

如果它没有被以某种方式改变了像

If it hasn't been changed in some manner like

$_POST = 'not array';

那么它就是数组; - )

then it is array ;-)

这篇关于PHP - 检查是否$ _POST是数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆