<?php $x = 'k5'; echo preg_replace('/k(\d+)/', 'k-${1}', $x);
You have javascript disabled. You will not be able to edit any code.