How to get text after the match REGEX
I have string "my home" and regex: $reg = "/hom/" for example. I'm struggling to find out how can I get text after the match (until the end of word), in this case I'm looking for 'e'.
$string = 'soulful'; $reg = '/soul/';
=>>> I need 'ful'. Thank you in advance.
You can use:
$str = 'soulful'; $reg = '/soul(\w+)/'; if ( preg_match($reg, $str, $m) ) print_r ($m);
Array (  => soulful  => ful )