PHP - Using only the first x characters of a database entry.

Soldato
Joined
26 Aug 2006
Posts
9,726
Location
62.156684,-49.781113
Long day at work, now my Google is failing me for what was meant to be a quick alteration. I want a preview of the first x characters of a larger block of text stored in mysql database. I've retrieved the string, now how can I cut the first so many characters out into a new variable? :)

Apologies if this is really simple, I'm picking up PHP as I go along because there's a delay on my book order, I got bored of waiting...
 
Yeah, I went back to thinking properly. Here's a more complicated one then, how can I stop it from cutting off in the middle of a word? :p
 
Back
Top Bottom