如何匹配路径分隔符
$win_dir = 'C:\hello.txt';
$linux_dir = '/home/hello.txt';
如何使用preg_match()对变量$win_dir如何匹配出\并输出。以及对$linux_dir如何匹配出/并输出。还有如何匹配出\\或者//
谢谢各位!!
如何匹配路径分隔符
$win_dir = 'C:\hello.txt';
$linux_dir = '/home/hello.txt';
如何使用preg_match()对变量$win_dir如何匹配出\并输出。以及对$linux_dir如何匹配出/并输出。还有如何匹配出\\或者//
谢谢各位!!
4 回答968 阅读
1 回答649 阅读✓ 已解决
2 回答619 阅读
1 回答828 阅读
604 阅读
无需用正则匹配的,用PHP自带的
DIRECTORY_SEPARATOR即可,windows平台输出
\,Linux平台输出/