Jump to content

[SOLVED] Check if array/var is directory or file


JMair

Recommended Posts

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>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.