Is there any way to limit text in php and after that to add expand/collapse option?
For example:
I have a note which is 500 characters long, and if i set text limit ($notetlimit =100;) I will get 100 characters, after that, I would like to insert image (circle,arrow etc.) which will show the rest of the text on click and change to another image (arrow up for example), and close the rest of the text again on click. Kinda like page break.
Is that possible or do I have to use js for expand and collapse?
You can use this function to limit the text…
Where $string is the text that you will be limiting to a length of $min = 1000
Now to expand or collapse text as same as google plus do, us can use the truncate.js file.