jheinz
1
mal eine Frage an die PHP Spezies
ich würde aus dem Array den Wert „DisplayName“ ausgeben.
Alle meine Versuche waren leider ohne Erfolg:rolleyes:
array (
'REMOTECONTACT' =>
stdClass::__set_state(array(
'IsValid' => 'TRUE',
'DirectWebLink' => '',
'DisplayName' => 'Heinz/ComaTec
Kommunikationstechnik GmbH',
'Custom9' => '',
)),
'EVENT' => 0,
'RETURN' => 0,
)
tommi
2
Keine Ahnung, was __setState macht. Wenn das eine Function ist, wirst Du wohl die entsprechende __getState-Funktion aufrufen müssen.
Als reines Array geht das jedenfalls so:
<?
$a=array (
'REMOTECONTACT' =>
array(
'IsValid' => 'TRUE',
'DirectWebLink' => '',
'DisplayName' => 'Heinz/ComaTec
Kommunikationstechnik GmbH',
'Custom9' => '',
),
'EVENT' => 0,
'RETURN' => 0,
);
echo $a['REMOTECONTACT']['DisplayName'];
?>
Tommi
jheinz
3
Hallo Tommi,
danke für deine Hilfe…
Ich bekomme folgende Meldung:
Cannot use object of type stdClass as array in <b>C:\Programme\IP-SYMCON\scripts\.currentscript</b> on line <b>16</b><br />
mit
echo var_export ($a);
wird das Array komplett angezeigt ![:confused: :confused:](https://community.symcon.de/images/emoji/win10/confused.png?v=9)
GGGss
4
Cannot use object of type stdClass as array in
Weil der type ‚stdClass‘ noch nicht definiert ist…