Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (strlen($post->post_title) > 20)
- echo substr($post->post_title, 0, 20) . ' ...';
- else
- echo $post->post_title;
- ?>
- ============================ atau:
- echo mb_strimwidth($post->title, 0, 20, ' ...');
- ===========================
- kalau ga support php bisa pakai html + css juga bisa, tinggal set widthnya dan tambahin text-overflow: ellipsis;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement