\" sign" />
开发者

php preg_match_all custom pattern

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜