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