How can you limit the number of characters displayed in a string in PHP?

To limit the number of characters displayed in a string in PHP, you can use the `substr()` function. This function allows you to extract a portion of a string based on a specified start position and length. By using `substr()` with the desired length of characters, you can effectively limit the displayed characters in the string.

$string = "Lorem ipsum dolor sit amet";
$limitedString = substr($string, 0, 10); // Limiting to 10 characters
echo $limitedString; // Output: "Lorem ipsu"