Opps, I forgot to answer the rest of your question. Here's a short example:
<?php
$mystr = "hello everybody out there in PHP land.";
$stringlength = strlen($mystr);
print "There are $stringlength letters in the word \"$mystr\".";
if($stringlength >= 12)
{
$mystring = substr($mystr, 0, 12);
print "<br><br>The first 12 letters are: \"$mystring\"";
}
else
{
$mystring = $mystr;
print "<br><br>The string is \"$mystring\" and has $stringlength characters in it.";
}
?>