JMair Posted August 20, 2009 Share Posted August 20, 2009 Can somebody show me how to check if a variable is a directory or a file? Thanks! Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 20, 2009 Share Posted August 20, 2009 The PHP documentation team can. is_dir is_file Quote Link to comment Share on other sites More sharing options...
JMair Posted August 20, 2009 Author Share Posted August 20, 2009 The PHP documentation team can. is_dir is_file Thank you for the quick reply. I was playing with that originally, but the is_dir would print out 'bool(true)' How could I stop this? Can I do something like $isDir = var_dump(is_dir('bogus_dir/abc')); if ($isDir == "1") echo "It's a Directory"."<br>"; else echo "It's some kind of file"."<br>"; Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 20, 2009 Share Posted August 20, 2009 Maybe you should check out what var_dump does Quote Link to comment Share on other sites More sharing options...
JMair Posted August 20, 2009 Author Share Posted August 20, 2009 Maybe you should check out what var_dump does Thank you master Daniel0. So wise. That's exactly what I needed! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.