PHP class for manipulating strings