$message_parts = explode(' ',$string); // problem
foreach($message_parts as $k=>$part){
$part_length = strlen($part);
if($part_length > 15){
$part = substr($part,0,13).'..';
}
$new_part[$k] = $part;
}
$string = implode(' ',$new_part);
This code limits only a single word greater than 15 characters in a string and not the whole string so if none of the words is over 15 characters it won't do much.
To return only a certain number of characters in a string you just need to use
$string_lenght = 50;
$new_string = substr($string,0,$string_lenght);