Jump to content

Testing if an embedded array exists in a $_POST


phdphd

Recommended Posts

Hi All,

 

There is a very interesting solved topic here (http://www.phpfreaks.com/forums/index.php?topic=304966.0) about how to access elements in embedded _POST array.

 

But before accessing an element, it might be appropriate to check whether the array it is supposed to be in exists.

 

According to the solution given in the topic indicated above,

$_POST['matType']

is an example of embedded array . Is there a way to check if this array exists?

 

Thanks in advance for your help.

According to the solution given in the topic indicated above,

$_POST['matType']

is an example of embedded array . Is there a way to check if this array exists?

You can check if matType exists, but then you separately need to make sure it's an array. Know that neither does the job of the other so you do need both.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.