Welcome Guest, Not a member yet? Register   Sign In
character_limiter not working?
#1

[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?


Messages In This Thread
character_limiter not working? - by El Forum - 06-25-2010, 04:57 AM
character_limiter not working? - by El Forum - 06-25-2010, 05:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB