Jump to content

Max char


mikelmao

Recommended Posts

I would also add a query string variable on the 'read more' link like ?disp=all

 

Then on the same page you can alter the code from Jabop:

 

<?php
$string='asdfasdfasdfasdfadfasdfasdfadfadfadfasdfadfadfasdfadfadfsdfsdfsdfafasdsdfsdfsdfsdfdf';
$disp = $_GET['disp'];
if (strlen($string)>130 && !$disp=='full') {
     echo substr($string, 0, 130) . ' read more omg click here';
} else {
     echo $string;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/138812-max-char/#findComment-725896
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.