$input = "hi frinds who are you"; preg_match(\'~( .*o)~\', $input, $output);
$output[1] \\ frinds who
i want only who (last space before word ending