2

I want to display the first 100 characters of a user's bio and then put an option of Read More, that will open a new page with complete details. Following is my code:

<p>
<?php echo substr($search->bio, 0, 100); ?>..... <a href='<?=base_url();?>user/profile/<?php echo $search->user_id; ?>'>Read more</a>
</p>

Now the problem with the code is that it also counts the white space as character. Is there any way to ignore the spaces? Please Help.

Ajmal Razeel
  • 1,663
  • 7
  • 27
  • 51

0 Answers0