How can the PHP manual be effectively used to troubleshoot and understand functions like preg_match?

To troubleshoot and understand functions like preg_match in PHP, you can refer to the PHP manual for detailed information on how the function works, its parameters, and examples of usage. By reading the manual, you can better understand how to use preg_match effectively and troubleshoot any issues you may encounter.

$pattern = '/^Hello/';
$string = 'Hello World';

if (preg_match($pattern, $string)) {
    echo 'Match found!';
} else {
    echo 'No match found.';
}