Im using the following on a page to limit the amount of characters are displayed for a products description:
Quote:
<?php
function custom_echo($x, $length)
{
if(strlen($x)<=$length)
{
echo $x;
}
else
{
$y=substr($x,0,$length) . '...';
echo $y;
}
}
?>
|
Followed by calling the shortened description like this:
Quote:
<?php custom_echo($row['style-info'], 100); ?>
|
It works perfectly however, I'm wanting to add this onto the end after the period marks:
... More
With a clickable link using a link setup this way:
domain.com/page.php?id=$ID
How would I go about editing the code I'm currently using to facilitate that?
I have tried adding the HTML code next to the periods but, that didnt work for some reason
Should I be using something different entirely?
Any help, pointers or advice would be appreciated.
Thanks
