On Mar 1, 1:58 am, Hendri Kurniawan <ask...@email.comwrote:
Quote:
get_object_vars will actually give you an array of properties an object have
>
Hendri
>
JamesG wrote:
>
Quote:
I have the following object, I need to extract the SysMessage
property.
>
Quote:
stdClass Object ( [UnknownConsignment] =stdClass Object
( [SysMessage] =Your consignment could not be found on our
system ) )
>
Quote:
I could do this:
$object->UnknownConsignment->SysMessage
>
Quote:
However, depending on the condition, the "UnknownConsignment" property
might be called something else.
Therefore, I need a solution, something like an array:
$object->[0]->SysMessage
>
Quote:
Thanks in advance!
Thanks for the tip.
I'm trying to use this, but it's not working how I like.
The array is now as follows:
Array ( [UnknownConsignment] =stdClass Object ( [SysMessage] =Your
consignment could not be found on our system ) )
So you would assume by using: $array[0] would access the object, and:
$array[0]->SysMessage contains the message I want.
This does not work! I know it's something silly, so any further help
is appreciated!
Thanks again