<?php strtr(string $string, string $from, string $to): string
<?php $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; $permissions = strtr($permissions, $map); $parts = str_split($permissions, 3);