I've written a class that looks at different parts of an email message. One function is to determine if each part is a file, by checking if a file name is present in its array of properties.
My check looks like:
if (array_key_exists("filename",$body_part->d_parameters)) {
// do stuff
}
But I keep getting this error in my logs because in cases where the part is not a file (header, body etc.) there is no array key called "filename."
PHP Notice: Undefined property: stdClass::$d_parameters in mail.php
PHP Warning: array_key_exists() expects parameter 2 to be array, null given in mail.php