3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 43; $substitutes = range('a', 'j'); $formatted = sprintf('%010d', $number); $string = preg_replace_callback('/./', function ($m) use ($substitutes) { return $substitutes[$m[0]]; }, $formatted); echo $string;

preferences:
39.17 ms | 402 KiB | 5 Q