...

View Full Version : Cannot use object of type stdClass as array



angst
07-13-2007, 01:13 AM
Hello,
i'm getting this error:

Fatal error: Cannot use object of type stdClass as array in /home/mail/msg.php on line 233

while looping through an array. I'm wondering how can i check the array first to make sure that this doesn't existing in the array, and if it does, how can I remove it?

[php]
Array ( [0] => stdClass Object ( [type] => 2 [encoding] => 0 [ifsubtype] => 1 [subtype] => RFC822 [ifdescription] => 1 [description] => Contents of original mail message [ifid] => 0 [lines] => 43 [bytes] => 1345 [ifdisposition] => 0 [ifdparameters] => 0 [ifparameters] => 0 [parameters] => stdClass Object ( ) ) )
Fatal error: Cannot use object of type stdClass as array in /home/mail/msg.php on line 233
[php]


thanks in advance for your time!
-Ken

StupidRalph
07-13-2007, 12:41 PM
there is the array_key_exists() (http://www.php.net/array-key-exist)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum