What PHP functions can be used to determine the length of a string and display only the first 15 characters?

To determine the length of a string in PHP, you can use the `strlen()` function. To display only the first 15 characters of a string, you can use the `substr()` function along with `strlen()` to ensure that only the first 15 characters are displayed.

$string = "This is a sample string.";
$length = strlen($string);
$first_15_chars = substr($string, 0, 15);

echo "Length of string: " . $length . "<br>";
echo "First 15 characters: " . $first_15_chars;