Reputation: 5517
I have a variable that needs it's value's shortened until they are 13 characters. It needs to chop off characters from the beginning of the string. Is this built into PHP?
Upvotes: 1
Views: 98
Reputation: 1088
The substr
function is what you're looking for,
$text = "abcdefghijklmnopqrstuvwxyz";
$text = substr($text, -13);
Upvotes: 2