3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "ZpglnRxqenU"; $output = []; for ($i = 0;$i<strlen($str);$i++) { $output[] = str_repeat($str[$i], $i+1); } $output = ucwords(strtolower(implode('-',$output)),"-"); echo $output;

preferences:
36.45 ms | 407 KiB | 5 Q