<?php
$text = "Принадлежность того или иного символа к буквенным определяется с учетом текущей локали.";
function tooLong($string)
{
$text_array = preg_split("/[\s,.?!]+/", $string, 0, PREG_SPLIT_NO_EMPTY
); foreach ($text_array as $k => &$str)
{
if ($length > 10)
{
$length -= 2;
$str = $firstLetter.$length.$lastLetter;
}
}
$words = '';
foreach ($text_array as $key => $value)
{
$words.=$value." ";
}
return $words;
}
PD9waHAKbWJfaW50ZXJuYWxfZW5jb2RpbmcoIlVURi04Iik7CiR0ZXh0ID0gItCf0YDQuNC90LDQtNC70LXQttC90L7RgdGC0Ywg0YLQvtCz0L4g0LjQu9C4INC40L3QvtCz0L4g0YHQuNC80LLQvtC70LAg0Log0LHRg9C60LLQtdC90L3Ri9C8INC+0L/RgNC10LTQtdC70Y/QtdGC0YHRjyDRgSDRg9GH0LXRgtC+0Lwg0YLQtdC60YPRidC10Lkg0LvQvtC60LDQu9C4LiI7CgpmdW5jdGlvbiB0b29Mb25nKCRzdHJpbmcpCnsKCSR0ZXh0X2FycmF5ID0gcHJlZ19zcGxpdCgiL1tccywuPyFdKy8iLCAkc3RyaW5nLCAwLCBQUkVHX1NQTElUX05PX0VNUFRZKTsKCXByaW50X3IoJHRleHRfYXJyYXkpOwoJZm9yZWFjaCAoJHRleHRfYXJyYXkgYXMgJGsgPT4gJiRzdHIpCgl7CgkkbGVuZ3RoID0gbWJfc3RybGVuKCRzdHIsICdVVEYtOCcpOwoJaWYgKCRsZW5ndGggPiAxMCkKCXsKCQoJJGxlbmd0aCAtPSAyOwoJJGZpcnN0TGV0dGVyID0gbWJfc3Vic3RyKCRzdHIsIDAsIDEpOwoJJGxhc3RMZXR0ZXIgPSBtYl9zdWJzdHIoJHN0ciwgLTEpOwoJJHN0ciA9ICRmaXJzdExldHRlci4kbGVuZ3RoLiRsYXN0TGV0dGVyOwoJfQoJfQoJJHdvcmRzID0gJyc7Cglmb3JlYWNoICgkdGV4dF9hcnJheSBhcyAka2V5ID0+ICR2YWx1ZSkKCXsKCQkkd29yZHMuPSR2YWx1ZS4iICI7Cgl9CglyZXR1cm4gJHdvcmRzOwp9CnByaW50X3IodG9vTG9uZygkdGV4dCkpOwo=