What are some alternative methods to extract data from a string in PHP?

When extracting data from a string in PHP, one alternative method is to use regular expressions. Regular expressions provide a powerful way to search for and extract specific patterns of text within a string. Another method is to use PHP's built-in string functions such as `strpos`, `substr`, `explode`, and `preg_match` to extract data based on specific delimiters or patterns. Example PHP code snippet using regular expressions to extract data from a string:

```php
$string = "Hello, my email is example@email.com";
$pattern = '/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/';
preg_match($pattern, $string, $matches);
$email = $matches[0];
echo $email;
```

In this example, the regular expression pattern is used to extract an email address from the given string. The `preg_match` function is then used to search for the pattern within the string and store the matched email address in the `$matches` array. Finally, we retrieve and display the extracted email address.