<?php $cool = '[#231234] S1234ubject'; preg_match( '/^\[#(\d+)\]/', $cool, $matches); echo $matches[1]; // 1234 echo $cool;
You have javascript disabled. You will not be able to edit any code.