Try extracting the array values through "VBScript". Yes, you read it right ...
<?php
$com = new COM("MSScriptControl.ScriptControl");
$com->Language = 'VBScript';
$com->AllowUI = false;
$com->AddCode('
Function getArrayVal(arr, indexX, indexY)
getArrayVal = arr(indexX, indexY)
End Function
');
$y1 = 0;
$y2 = 1;
for ($x=0; $x < count($mdArray); $x++) {
echo $com->Run('getArrayVal', $mdArray, $x, $y1) . ": ";
echo $com->Run('getArrayVal', $mdArray, $x, $y2) . "\n";
}
?>
It is well tested in the array created by VBScript, which otherwise gave me the same problems and errors as you, trying to make it behave like a PHP array. The above method, spawned by the unholy combination of PHP and VBscript, should retrieve values piecemeal just fine.
To explain $y1 = 0; $y2 = 1;, keep in mind that the parameters of the VBScript function are byref, so you cannot pass anything but a variable.
: $com->AllowUI = false, . , MsgBox() VBScript, , "ok".