Cut String from the end after certain number of characters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Cut String from the end after certain number of characters

Post by donny »

hello

can somebody tell me how to use the substr() command so if i have a string like this

$alphabet = abcdefghijklmnopqrstuvwxyz

i want the max length of the string to be 15 characters and i want it to cut off after the 15th character

so $alphabet would become abcdefghijklmno

thank you
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Re: Cut String from the end after certain number of characte

Post by donny »

i got it . thanks a lot
kladrian
Forum Newbie
Posts: 4
Joined: Thu Aug 14, 2014 9:20 am

Re: Cut String from the end after certain number of characte

Post by kladrian »

hi,
I know the answer but it would be nice to write the solution not just "i got it" for other people

thanks a lot :D
Post Reply