Tom-743
26-07-2008, 07:50 PM
Im trying to limit a string to 10 characters, but i can't work out how to do it. Ive tried string pad but it can only be used to make the string bigger;
$shorten = "hihihihihihihihihihiihhihihihihihihih";
$shorten = str_pad ( $shorten, 10 );
echo $shorten
That just echos "hihihihihihihihihihiihhihihihihihihih". Is there any function to shrink a string?
$shorten = "hihihihihihihihihihiihhihihihihihihih";
$shorten = str_pad ( $shorten, 10 );
echo $shorten
That just echos "hihihihihihihihihihiihhihihihihihihih". Is there any function to shrink a string?