npm install -g cnpm --registry=http://registry.npm.taobao.org
php的一个不错的方法:
pathinfo() 函数以数组的形式返回文件路径的信息。
<?php print_r(pathinfo("/testweb/test.txt")); ?>
输出
Array ( [dirname] => /testweb [basename] => test.txt [extension] => txt )
若是:
<?php print_r(pathinfo("/testweb/test.txt",PATHINFO_BASENAME)); ?>
test.txt