{myadvertisements[zone_1]}
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to limit text length in php and provide 'Read more' link
#1
If you have set your php site to display post excerpts on the front or home page, you will want visitors to click on the title or a link to encourage them to continue reading your post or article, right? php makes this technique easy, and customizable.

PHP Code

Code:
<?php
  $string = $profileinfo['description'];
  if (strlen($string) > 150) {
      $stringCut = substr($string, 0, 150);
      $endPoint = strrpos($stringCut, ' ');
      $string = $endPoint? substr($stringCut, 0, $endPoint):substr($stringCut, 0);
      $string .= '... <a style="cursor: pointer;" href="" >Read More</a>';
  }
  echo $string;
?>
To Purchase Credit Click here , For how to make money on Sologet forum Click here 

HIRE ME FOR WEBSITE DESIGNING USE THE PM BUTTON TO SEND ME MESSAGE

There is love in sharing
{myadvertisements[zone_3]}
#2

It is a good way to encourage members to click on your link.

https://jiji.ng/igando-ikotun/classes-and-courses/personal-php-and-mysqli-training-5L4GkyIFBUBTNyHokpSlVwXv.html?lid=ixncYtDjxftf5Kdq&cur_pos=6&pos=6&ads_count=7&ads_per_page=7&page=1

{myadvertisements[zone_3]}
  


Possibly Related Threads…
Thread Author Replies Views Last Post
  COMING SOON How To Get The Homework Help Online For Free maxy01 1 156 04-14-2021, 05:53 PM
Last Post: Poppy Jones
  How do you write a modern essay? Poppy Jones 0 112 04-14-2021, 05:52 PM
Last Post: Poppy Jones
  technical help john8520 1 356 04-09-2021, 07:55 PM
Last Post: Katedavis
  How can I find a fantastic custom essay writing service? Katedavis 0 90 04-09-2021, 07:53 PM
Last Post: Katedavis
  Best latte machines jendavis 1 192 04-07-2021, 07:19 PM
Last Post: RyanHell

Forum Jump:


Users browsing this thread:
1 Guest(s)

{myadvertisements[zone_2]}
How to limit text length in php and provide 'Read more' link00