Hi,
I'm very new to PHP, and am toying with some COM samples... specifically
the Windows FileSystem object.
This object has a property Drives, which returns a collection of Drive
objects (one for each drive letter). How can I enumerate this collection?
Here's the very basics:
$fs = new COM("Scripting. FileSystemObjec t");
$drives = $fs->Drives;
echo("$drives->Count Drives");
This much works correctly (I get "4 Drives").
The next logical thing I'd like to do is something like:
foreach($drives as $drive)
{
echo $drive->VolumeName;
}
....however, I don't get the expected results. If I add a diagnostic
echo, it get's fired once (rather than 4 times) and the existing echo
neither returns anything or any error.
Thoughts?
Is this a syntax thing, or a fundamental "PHP isn't VB mate"
misunderstandin g on my part? ;)
Ta,
Jon
I'm very new to PHP, and am toying with some COM samples... specifically
the Windows FileSystem object.
This object has a property Drives, which returns a collection of Drive
objects (one for each drive letter). How can I enumerate this collection?
Here's the very basics:
$fs = new COM("Scripting. FileSystemObjec t");
$drives = $fs->Drives;
echo("$drives->Count Drives");
This much works correctly (I get "4 Drives").
The next logical thing I'd like to do is something like:
foreach($drives as $drive)
{
echo $drive->VolumeName;
}
....however, I don't get the expected results. If I add a diagnostic
echo, it get's fired once (rather than 4 times) and the existing echo
neither returns anything or any error.
Thoughts?
Is this a syntax thing, or a fundamental "PHP isn't VB mate"
misunderstandin g on my part? ;)
Ta,
Jon
Comment