PHP

[PHP] php使用正则表达式

2016-03-03  本文已影响6人  何幻
$pattern="/^.*\/(.+?)$/";
$matchCount=preg_match($pattern,$filePath,$matches);
$fileName=$matches[1];

<u></u>preg_match方法只进行一次匹配,返回匹配的数量(0或1)。

上一篇 下一篇

猜你喜欢

热点阅读