$str = "Hello World!"; echo substr($str, 6); // Outputs "World!"
$str = "Superman"; echo substr($str, 0, 5); // Outputs "Super"In this example, the first parameter is the string to extract from, the second parameter is the starting index (0), and the third parameter is the length of the substring (5). The substr() function is part of PHP's core functions and does not require any external package or library.