从php中的url中提取值

Pig*_*igi 1 php url substr strpos

我有一个类似于此的URL:

http://somethinfs.com/folder/134039/the_title_of_somethings.html
http://somethinfs.com/folder/184738/the_title_of_somethings_else.html

从这个URL,我需要提取"134039"和"184738".我试过使用strpos和substr但它不起作用,它只是回复我.html.

Mob*_*Mob 7

混合物parse_urlexplode将会这样做.

$a = parse_url("http://somethinfs.com/folder/184738/the_title_of_somethings_else.html");
$b = explode("/", $a['path']);
echo $b[2]; 
Run Code Online (Sandbox Code Playgroud)

输出是 184738