<?php $string = 'PT3M'; $pattern = 'PT?[0-9]+[SMWYD]'; $replacement = '#'; echo preg_replace($pattern, $replacement, $string);
You have javascript disabled. You will not be able to edit any code.