我的网站的“阅读更多”功能存在问题


Issues with "Read More" feature of my website

我需要你的帮助为我的网站做一个阅读更多功能。将应用"阅读更多"功能的内容是动态生成的。当我实现它时,我点击 阅读更多...我被带到了同一页面,全文显示。

请问我该如何解决这个问题。

谢谢。

<?php
$row['article_content'];
if (strlen($row['article_content']) > 500) {
  $shortText = substr($row['article_content'], 0, 100);
    $shortText .= '... <a href="site/article.php?id=' . $id . '">Read More</a>
 echo $shortText;

} ?>

<?php
if(isset($_GET['readmore']))
echo $row['article_content'];
else
echo get_short_text($row['article_content']); 

function get_short_text($article)
 {
   $shortText="";
   if (strlen($article) > 500) {
       $shortText = substr($article, 0, 100);
       $shortText .= '... <a href="site/article.php?id=' . $id . '&readmore=1'>Read More</a>
   }
   else { $shortText = $article; }
   return $shortText;
 }