random1 Posted September 12, 2008 Share Posted September 12, 2008 How can you get an array that contains the letters of disk drives (C,D,E etc) on the current server using PHP? ??? Link to comment https://forums.phpfreaks.com/topic/123873-solved-getting-the-letters-of-disk-drives-using-php/ Share on other sites More sharing options...
Lodius2000 Posted September 12, 2008 Share Posted September 12, 2008 //wild stab <--- knows ZERO apache but i think that may be where you need to go, php is the middleman between the user level(html) and the server (apache) but i bet apache could provide php with the disk letters Link to comment https://forums.phpfreaks.com/topic/123873-solved-getting-the-letters-of-disk-drives-using-php/#findComment-639544 Share on other sites More sharing options...
priti Posted September 12, 2008 Share Posted September 12, 2008 How can you get an array that contains the letters of disk drives (C,D,E etc) on the current server using PHP? ??? you can make use of following trick foreach ( range( 'a', 'z' ) as $drive ) { if ( file_exists( $drive . ':\\')) { echo $drive . ': \ exists'; } } Link to comment https://forums.phpfreaks.com/topic/123873-solved-getting-the-letters-of-disk-drives-using-php/#findComment-639674 Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 That's a nice one. It detected hard drives, but omitted DVD (as there was no disc inside) and virtual drive (as nothing was mounted). Link to comment https://forums.phpfreaks.com/topic/123873-solved-getting-the-letters-of-disk-drives-using-php/#findComment-639686 Share on other sites More sharing options...
Lodius2000 Posted September 12, 2008 Share Posted September 12, 2008 sneaky... I like it Link to comment https://forums.phpfreaks.com/topic/123873-solved-getting-the-letters-of-disk-drives-using-php/#findComment-640119 Share on other sites More sharing options...
priti Posted October 24, 2008 Share Posted October 24, 2008 Glad to know. Link to comment https://forums.phpfreaks.com/topic/123873-solved-getting-the-letters-of-disk-drives-using-php/#findComment-673657 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.