What is the function in PHP that can be used to extract a specific substring from a string?

To extract a specific substring from a string in PHP, you can use the `substr()` function. This function takes three parameters: the original string, the starting position of the substring, and the length of the substring to extract. By providing the appropriate values for these parameters, you can easily extract the desired substring from the original string.

// Original string
$string = "Hello, World!";

// Extracting a substring starting from position 7 with a length of 5 characters
$substring = substr($string, 7, 5);

// Output the extracted substring
echo $substring; // Outputs "World"