limiting an echo
Posted: Thu Apr 20, 2006 9:22 am
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?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$string = "This is a string that might have 25 characters or so";
echo substr($string, 0, 5);
// outputs: This