Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
URL パスの例があります。
1. /1/another.part?param1=1¶m2=2 2. /1000/another.part2?param1=1¶m2=2
PHPを使用して1または1000(/と/の間の数字)を取得するにはどうすればよいですか?
ありがとう。
あなたはこれを使うことができます、
var number=document.location.href.split('?')[1]
explodeこの機能を試す
explode
$str = explode('/','/1/another.part?param1=1¶m2=2'); echo $str[1];