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.
.html
Mob*_*Mob 7
混合物parse_url和explode将会这样做.
parse_url
explode
$a = parse_url("http://somethinfs.com/folder/184738/the_title_of_somethings_else.html"); $b = explode("/", $a['path']); echo $b[2];
输出是 184738
184738
归档时间:
14 年,1 月 前
查看次数:
139 次
最近记录: