<?php $myfile = "user/home/documents/gfg"; // checking whether a file is directory or not if (is_dir($myfile)) echo ("$myfile is a directory"); else echo ("$myfile is not a directory"); ?>