In php, I need to find if a directory exists. IF it does not exist (I will show a hyperlink for this using the name dirname)
Here is an example where I need help.
dir_name is the name of the directory
$url = system(~'ls -d /home/myapps/rel/".$dir_name"');
echo $url;(this does not work)
if(preg_match("/No such/",$url)) {
echo'Ther is no match'
}
else{
}
In my code, the if block is never executed. (it should be executed if the directory does not exist); (
source
share