I'm working with a COM object that returns a multidimensional VARIANT array (vt_array), and I'm trying to read values from the array.
When I use print_r($mdArray)
it displays variant Object
.
(variant_get_type($mdArray)
returns 8204
.)
I tried using foreach ($mdArray as $oneArray)
but I get the message:
Warning: Loader::getfields() [loader.getfields]: Can only handle single dimension variant arrays (this array has 2) in C:\Inetpub\wwwroot\root\script\fileloader.php on line 135 Fatal error: Uncaught exception 'Exception' with message 'Object of type variant did not create an Iterator' in C:\Inetpub\wwwroot\root\script\fileloader.php:135 Stack trace: #0 C:\Inetpub\wwwroot\root\script\fileloader.php(135): Loader::getfields() #1 C:\Inetpub\wwwroot\root\testloader.php(21): Loader->getfields() #2 {main} thrown in C:\Inetpub\wwwroot\root\script\fileloader.php on line 135
(The foreach loop is on line 135)
The only information I can get about the array is by using count($mdArray)
which returns 8
.
If anyone here has any experience reading from multidimensional VARIANT arrays please tell me how this can be done.