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!
Question: Say I have a news article stored in my database and I want to just list the title and a brief exerpt from in on say an index page.
Can I create an additional variable based on $body (below) that says to just return the first 100 characters or the article?
Which brings you how to properly chop text. Atleast this way you won't chop text in the middle of words, could even modify it to not chop in the middle of sentences I guess too.