- preg_match: documentation ( source)
- print_r: documentation ( source)
<?php
$subject = '"John" <john.willmott@nelson-hall.com>';
$pattern = '/"(.*)"/s';
preg_match($pattern, $subject, $matches);
print_r($matches);
$pattern = '/<(.*)>/s';
preg_match($pattern, $subject, $matches);
print_r($matches);