| Posted by Noodle on 01/11/07 21:50 
roby wrote:> Hello everyone, I'm a beginner in PHP and I want to ask about
 > directory. How to check correctly if the directory already exist in the
 > webroot? I've tried with this syntax:
 > ...
 > bool $state = mkdir( "test" );
 > if ( $state == false ) chdir( "test" );
 > ...
 > but on the page there is a warning. How to solve this problem? Thanks
 > in advance.
 
 Or you could do something like this if you don't need the state
 recorded...
 
 <?
 
 if(is_dir("test")){
 chdir("test");
 }
 
 ?>
  Navigation: [Reply to this message] |