Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts

    Cannot use object of type stdClass as array

    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

  • #2
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    there is the array_key_exists()
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •