Page 1 of 1

creating multiple directory

Posted: Thu Jul 26, 2007 1:33 am
by webgroundz
hello guys!, do you have any idea how to create multiple directory?.

thanks...any suggestion is highly appreciated.. :) :) :)

Posted: Thu Jul 26, 2007 1:39 am
by John Cartwright
multiple calls to mkdir() ?

Posted: Thu Jul 26, 2007 1:41 am
by webgroundz
yes, is that possible?.thanks.. :)

Posted: Thu Jul 26, 2007 2:10 am
by webgroundz
here's my sample code

Code: Select all

$this->destination('test1/test2/test3');
			$dir = explode('/', $this->destination_dir);
			foreach ($dir as $this->destination_dir)
			{
				if(!is_dir($this->destination_dir))
				{
					$directory .= $this->createDirectory($this->destination_dir, 0777);
				}
			}
what is wrong with my sample code snippet?.thanks. :)

Posted: Thu Jul 26, 2007 6:40 am
by miro_igov
I believe you should change it to :

Code: Select all

$this->destination('test1/test2/test3');
$dir = explode('/', $this->destination_dir);
$temp = '';
foreach ($dir as $this->destination_dir)
 {
   $temp .= $this->destination_dir.'/';
   if(!is_dir($temp))
   {
      $directory .= $this->createDirectory($temp, 0777);
   }
}

Posted: Thu Jul 26, 2007 6:22 pm
by webgroundz
thanks bro, it work fine now... :D :D :D