- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$re = '/^.*?:[ \t]+(\w+)/m';
$str = ' In respect of Shareholders
Name: xyx
Residential address: dublin
No of Shares: 2
Name: abc
Residential address: canada
No of Shares: 2';
preg_match_all($re, $str, $matches);
print_r($matches[1]);