$lastFour = substr($creditCardNumber, -1, 4);
thanks ldww, one function i totally forgot about. u saved the day.