You'll need some way of processing the string as checking for words is slightly more complex than checking for characters. This example is actually taken from the Laravel framework with some minor adaptations to make it work stand alone.
/**
* @param {String} the value to shorten
* @param {Integer} number of words allowed
* @param {String} what to put on the end of the string
* @return {String}
*/
function words($value, $words = 100, $end = '...')
{
preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches);
if ( ! isset($matches[0])) return $value;
if (strlen($value) == strlen($matches[0])) return $value;
return rtrim($matches[0]).$end;
}
Then you can use something like:
$title = words($title, 10, '<a href="#">Read more</a>');
To use this with your code:
$title = words($emlaklist->aciklama, 10, '');
Make sure that the function is declared, just copy paste from here if you want. Also make sure that $emlaklist->aciklama contains what you need.