Word cutoff function

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
Darkzaelus
Forum Commoner
Posts: 94
Joined: Tue Sep 09, 2008 7:02 am

Word cutoff function

Post by Darkzaelus »

Is there an inbuilt function to cut off a long piece of text after a certain amount of characters and append ... to the end of it?

Cheers,

Darkzaelus

p.s. If not I would like to write the code myself please, I prefer to work through solutions
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: Word cutoff function

Post by susrisha »

Darkzaelus
Forum Commoner
Posts: 94
Joined: Tue Sep 09, 2008 7:02 am

Re: Word cutoff function

Post by Darkzaelus »

wonderful, should have thought that myself but oh well :P

Cheers,

Darkzaelus
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Word cutoff function

Post by jayshields »

Surely substr() is more appropriate.
Darkzaelus
Forum Commoner
Posts: 94
Joined: Tue Sep 09, 2008 7:02 am

Re: Word cutoff function

Post by Darkzaelus »

Yea, it is, exactly what I was looking for.

Cheers,


Darkzaelus
Post Reply