扫码关注官方订阅号
http://www.xxx.com/one/two/three/four
将链接中每个 / 后面的字符查找出来,放到一个数组里,如: ['one','two','three','four'] 链接长度不限制。正则该怎么写?
/
['one','two','three','four']
window.location.pathname.split('/')
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
window.location.pathname.split('/')