PHP String Formatter

Run Settings
LanguagePHP
Language Version
Run Command
<?php function format($format, $value, $separator=' ') { $temp=[]; foreach ($format as $cluster){ $formattedCluster=substr($value,0,strlen($cluster)); $value=substr($value,strlen($cluster)); array_push($temp, $formattedCluster); } return join($separator, $temp); } var_dump(format(['xxxxxxxx', 'xxxxxx', 'x', 'xxx'], '197309262015051001'));
Editor Settings
Theme
Key bindings
Full width
Lines