How to check if filename is a directory in PHP

1 Answer

0 votes
/*
bool is_dir ( string $filename )
*/  
  
$s = "c:/xampp";
if (is_dir($s))
    echo "$s is a directory";
else
    echo "$s is not a directory";

/*
run:
  
c:/xampp is a directory

 



answered Dec 16, 2015 by avibootz

Related questions

2 answers 273 views
5 answers 1,228 views
1 answer 373 views
1 answer 329 views
2 answers 355 views
5 answers 640 views
...