What is the function in PHP to delete a portion of a string from a specific position to the end?

To delete a portion of a string from a specific position to the end in PHP, you can use the `substr_replace()` function. This function replaces a portion of a string with another string starting from a specified position. By using an empty string as the replacement, you can effectively delete the portion of the string.

$string = "Hello, World!";
$position = 7; // Position to start deleting from
$newString = substr_replace($string, "", $position);
echo $newString; // Output: Hello,