Execute unix command in php

RivioubNoilia

New Member
In php,I have to find whether a directory exist. IF it exists not a problem (I will display the hyperlink for that using the dirname)Here is the sample in which I need help.
dir_name is the directory name\[code\]$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{ }\[/code\]In my code the if block is never executed.(it should execute if the directory does not exist) ;(
 
Back
Top