limiting an echo
Moderator: General Moderators
- elecktricity
- Forum Contributor
- Posts: 128
- Joined: Sun Sep 25, 2005 8:57 pm
- Location: Trapped in my own little world.
- Contact:
limiting an echo
Hey I was wondering if this was possible, I had like a variable with 25 characters and I only wanted to display the first 5 characters?
Code: Select all
$string = "This is a string that might have 25 characters or so";
echo substr($string, 0, 5);
// outputs: This