Nope. In fact, your PHP script can't tell at all if something on another server is a directory at all, any more than you (as a user) can (for example, is
http://example.com/page1 a directory or a file?).
All you can know is the content that server returns to you. In some places, a site might return a plain-text listing of the directory's contents (such as
http://eeems.omnimaga.org/files/), while in other places it might return 403 Forbidden, in order not to show you what's inside. And if there's a file called index.html or default.html or anything like that, of course, that's exactly what the server will show you when you try to open that directory.