美文网首页PHP
[PHP] php使用正则表达式

[PHP] php使用正则表达式

作者: 何幻 | 来源:发表于2016-03-03 07:13 被阅读6次
$pattern="/^.*\/(.+?)$/";
$matchCount=preg_match($pattern,$filePath,$matches);
$fileName=$matches[1];

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

相关文章

网友评论

    本文标题:[PHP] php使用正则表达式

    本文链接:https://www.haomeiwen.com/subject/ojpnkttx.html