Here's my issue..
I have a long sentence or phrase ...
"abcdefg h ijklmn op qrst u vwxyz"
for exapmle .... I want to echo
"abcdefg ..."
Any suggestions ..how to do that?
Thanks in advance ...
Depends on why you want to echo 'abcdefg' - what is special about it?... is it because it's the first word? Maybe because it starts with 'a'? Maybe you all 7-letter words?
Check out the full list of PHP's String functions and find the one that does what you want.
Here's the function I was looking for
function cuttext($texto,$tamanho) { $texto = htmlspecialchars($texto); if (strlen($texto) > $tamanho) { $texto = substr($texto, 0, $tamanho); $texto .= " ..."; } return $texto; }
Thanks anyway :-)