What are some common string manipulation functions in PHP that can be used to extract a portion of a string?
When working with strings in PHP, it is common to need to extract a portion of a string based on certain criteria such as a specific starting position or length. PHP provides several built-in string manipulation functions that can be used to achieve this, such as substr(), strstr(), and strpos(). These functions allow you to extract a substring from a larger string based on different conditions like starting position, length, or a specific delimiter.
// Example of using substr() function to extract a portion of a string
$string = "Hello, World!";
$substring = substr($string, 7); // Extracts "World!" starting from position 7
echo $substring;