Are there any best practices for displaying truncated text with a link to the full content in PHP?

When displaying truncated text with a link to the full content in PHP, it is important to ensure that the truncation is done in a way that maintains the readability and coherence of the text. One common approach is to truncate the text at a specific character limit and add an ellipsis (...) at the end to indicate that there is more content available. The truncated text should also be wrapped in a link that directs users to the full content when clicked.

<?php
function truncate_text($text, $limit, $link) {
    if (strlen($text) > $limit) {
        $truncated_text = substr($text, 0, $limit) . '... <a href="' . $link . '">Read more</a>';
    } else {
        $truncated_text = $text;
    }
    return $truncated_text;
}

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

echo truncate_text($text, $limit, $link);
?>