note 61270 added to function.ftp-nlist

From: Date: Mon, 30 Jan 2006 00:28:56 +0000
Subject: note 61270 added to function.ftp-nlist
Groups: php.notes 
Request: Send a blank email to php-notes+get-102699@lists.php.net to get a copy of this message
<? // full_ftp_rmdir // sakinlesh if ($path){ // FTP info $server='server'; $user = "user"; $pass = "pass"; // FTP connect $ftp_stream = ftp_connect($server); $result = ftp_login($ftp_stream, $user, $pass); // full_ftp_rmdir function function full_ftp_rmdir($ftp_stream,$path){ // main path $mainpath = '/'; $mainpath = "main_file"; $arr_dosya = array(); //is file? if(is_dir($path)) { // file's info to $contents if($contents = opendir($path)) { // $contents to $node while(($dosya = readdir($contents)) !== false) { if (!is_dir($dosya)){ array_push($arr_dosya,$dosya); }//end if }//end while }//end if }//end if foreach ($arr_dosya as $dos){ // dir's full path $silinecek = $mainpath.'/'.$path.'/'.$dos; // file's full path @ftp_delete($ftp_stream, $silinecek); // continue listele($ftp_stream, $path.'/'.$dos); }// all files deleted // del empty dir @ftp_rmdir($ftp_stream, $mainpath.'/'.$path); } full_ftp_rmdir($ftp_stream, $path); // check if (is_dir($path)){ echo 'deleted';}else{ echo 'not deleted';} ftp_close($ftp_stream); } ?> ---- Server IP: 85.111.4.6 Probable Submitter: 85.103.38.18 ---- Manual Page -- http://www.php.net/manual/en/function.ftp-nlist.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61270 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61270&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61270&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61270&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61270&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61270&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61270&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61270&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61270&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102699) next »