stdClass Object
(
[ModuleAccountInfo] => Array
    (
        [0] => stdClass Object
            (
                [ServerName] => EAST
                [HostingModule] => ActiveDirectory
                [ActiveDirectorySiteName] => EAST
                [AccountIdentity] => OU=ndla,OU=Hosting,DC=east,DC=domain,DC=local
                [Groups] => 2
                [Users] => 15
            )
        [1] => stdClass Object
            (
                [ServerName] => EAST.net
                [HostingModule] => hange
                [DiskQuota] => 375000
                [DiskQuotaAdditional] => 0
                [DateQuotaExceeded] => 0001-01-01T00:00:00
                [DiskSpace] => 58567
                [MailboxesDiskSpace] => 59973051
                [PublicFoldersDiskSpace] => 0
                [MessageArchivingDiskSpace] => 0
                [Contacts] => 8
                [Mailboxes] => 15
How do I access the ServerName properties? This object is held in a $modules variables. The above is the print_r of $modules.
Because the ModuleAccountInfo property is an array, you'll either need to use a specific index
echo $modules->ModuleAccountInfo[0]->ServerName;
or loop
foreach ($modules->ModuleAccountInfo as $moduleAccountInfo) {
    echo $moduleAccountInfo->ServerName;
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With