Number Trim?
Moderator: General Moderators
Number Trim?
Say I have a phone number as a variable $number = "7345551234". Is there a function I can used to strip off the first 5 numbers so that I am left with only the last 5 in the variable? $number = "51234"
Re: Number Trim?
Yay thread #55000!
Those substrs are also links.
Code: Select all
echo substr("7345551234", -5); // last five
echo substr("7345551234", 5); // starting at the fifth character
// 51234