What is the best practice for displaying a "Read More" link only when the text is truncated in PHP?

When displaying text on a webpage, it is common to truncate long text to save space. To indicate to the user that there is more content available, a "Read More" link can be displayed. One way to achieve this in PHP is to check if the length of the text exceeds a certain limit, and if so, display the "Read More" link.

<?php
$text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
$limit = 50;

if(strlen($text) > $limit){
    echo substr($text, 0, $limit) . "... <a href='#'>Read More</a>";
} else {
    echo $text;
}
?>