[eluser]Unknown[/eluser]
Hello,
I have encountered the following behaviour while using the character_limiter function (CI 1.7.2):
It seems that if there are no spaces inside a long string, the function simply returns the whole string without truncating it at all.
Here is an example where the function works as expected:
Code:
$string="Lorem ipsum dolor sit amet consectetur adipiscing elit Sed et nibh eget est dapibus rhoncus eu sed metus In hac habitasse platea dictumst Aenean et lacus nibh";
echo character_limiter($string,10);
In the example above it returns "Lorem ipsum…" which is correct.
But in the example bellow it returns the whole string no matter how many characters i specify in the function's second parameter:
Code:
$string="LoremipsumdolorsitametconsecteturadipiscingelitSedetnibhegetestdapibusrhoncuseusedmetusInhachabitasseplateadictumstAeneanetlacusnibh";
echo character_limiter($string,10);
Did anyone else encountered this issue?