I have one string like
$string = ">xyz, >abc hi there and also hi to >nrm";
I want to find all occ开发者_Python百科urrences of words which are next to ">" sign for example in above string it would return all words xyz, abc and nrm
I tried some ways but no any result
Help me guys and thanks in advance
You can do the following:
preg_match_all("/>(\w+)/", $string, $matches);
// $matches[1] contains the matches you want.
See also: Example of it in action on Ideone
精彩评论