note 47706 deleted from function.chmod by sean
| From: | sean@php.net | Date: | Thu, 25 Nov 2004 19:57:48 +0000 |
| Subject: | note 47706 deleted from function.chmod by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81037@lists.php.net to get a copy of this message | ||
Note Submitter: Julio Cunha j0er at bol dot com dot br
----
To Convert 777 in rwxrwxrwx...
function chmodlet($mode) {
$Owner=$mode{0};
$Group=$mode{1};
$Other=$mode{2};
$trans =
array('7'=>'rwx','6'=>'rw-','5'=>'r-x','4'=>
'r--','3'=>'-wx','2'=>'-w-','1'=>'--x','0'=>'---');
$Owner = strtr($Owner,$trans);
$Group= strtr($Group,$trans);
$Other = strtr($Other,$trans);
$newmode = '';
$newmode = "$Owner$Group$Other";
return $newmode;
}
----
Reason: bad code