NiL*_*iLL 0 php pcre
我有一个网址, - " http://example.com/sales/view/id/705"我需要得到最后一段(705).
http://example.com/sales/view/id/705
我怎么能用PCRE做到这一点?
Eug*_*ash 6
这应该在Perl中完成:
my ($last) = $url =~ /([^\/]+)\z/;
但我宁愿使用该URI模块:
URI
my $last = (URI->new($url)->path_segments)[-1];
归档时间:
14 年 前
查看次数:
497 次
最近记录: