⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Add ... after x characters if string too long



ashokkumar
  • profile picture
  • Member

Posted 23 May 2018 - 08:36 AM

Hi

 

I am new to crud and i am facing this issue. I.E I have a description field in my MySQL database, and I access the database on two different pages, one page I display the whole field, but on the other, I just want to display the first 50 characters. If the string in the description field is less than 50 characters, then it won't show ... , but if it isn't, I will show ... after the first 50 characters.

 

Plz let me know how can i achieve in crud using CI