有时候需要去掉一个字符串中以首个字符串开始的时候,原来用正则表达式或者截串。
这个方法也不错:
$rootPath = "./www/xgo/ss/demo.js";
echo trim($rootPath, ".\\/\\");
最终结果:
www/xgo/ss/demo.js
有时候需要去掉一个字符串中以首个字符串开始的时候,原来用正则表达式或者截串。
这个方法也不错:
$rootPath = "./www/xgo/ss/demo.js";
echo trim($rootPath, ".\\/\\");
www/xgo/ss/demo.js