Na poczatek fragmenty kodu:
Kod
Object ( [value:protected] => stdClass Object ( [GetRolesResult] => stdClass Object ( [ServerID] => 12d4a65a-955f-479d-a8b9-bf70c5f75a2a [Status] => OK [TimeStamp] => 2012-05-23T11:52:06.515322+02:00 [Version] => 2 [Groups] => stdClass Object ( [RoleGroup] => stdClass Object ( [GroupID] => b8395df7-d963-4f46-ad93-506ebafaf960 [Name] => Administrator [Symbol] => ADM [Type] => A ) ) ) )
Object ( [value:protected] => stdClass Object ( [GetRolesResult] => stdClass Object ( [ServerID] => 12d4a65a-955f-479d-a8b9-bf70c5f75a2a [Status] => OK [TimeStamp] => 2012-05-23T11:56:52.745322+02:00 [Version] => 2 [Groups] => stdClass Object ( [RoleGroup] => Array ( [0] => stdClass Object ( [GroupID] => 79971909-26d4-4e92-9ed3-ac606b3a045e [Name] => Redaktor [Symbol] => RED [Type] => A ) [1] => stdClass Object ( [GroupID] => 35707a3c-5210-4766-9f84-cb605a341a57 [Name] => Moderator [Symbol] => MOD [Type] => A ) ) ) ) )
Object ( [value:protected] => stdClass Object ( [GetRolesResult] => stdClass Object ( [ServerID] => 12d4a65a-955f-479d-a8b9-bf70c5f75a2a [Status] => OK [TimeStamp] => 2012-05-23T11:56:52.745322+02:00 [Version] => 2 [Groups] => stdClass Object ( [RoleGroup] => Array ( [0] => stdClass Object ( [GroupID] => 79971909-26d4-4e92-9ed3-ac606b3a045e [Name] => Redaktor [Symbol] => RED [Type] => A ) [1] => stdClass Object ( [GroupID] => 35707a3c-5210-4766-9f84-cb605a341a57 [Name] => Moderator [Symbol] => MOD [Type] => A ) ) ) ) )
W pierwszym przypadku parametr "name" wyciagam przy uzyciu tej instrukcji: $r->GetRolesResult->Groups->RoleGroup->Name;
W drugim natomiast:
$r->GetRolesResult->Groups->RoleGroup[0]->Name;
oraz
$r->GetRolesResult->Groups->RoleGroup[1]->Name;
W jaki sposob za pomoca jednej instrukcji wyciagac nazwy uzytkownikow (ujednolicic pobieranie struktury)? Zarowno, gdy mamy do czynienia z "tablica", jak i "skalarem"?
Bylbym wdzieczny za pomoc.