如何使用php知道idhttp://elcinema.tv/system/videos/{this id}/sd.flv

如何使用php知道idhttp://elcinema.tv/system/videos/{this id}/sd.flv,php,Php,比如说 我想知道使用php的id-(1796)是什么 全文如下: // 不需要regexp,请尝试以下操作: $url = 'http://elcinema.tv/system/videos/1796/sd.flv'; $parts = explode('/', $url); $id = $parts[count($parts)-2]; 最好的方法是使用正则表达式,但我将把它留给正则表达式专家:) $url = 'http://elcinema.tv/system/videos/1796/s

比如说 我想知道使用php的id-(1796)是什么

全文如下:

//

不需要regexp,请尝试以下操作:

$url = 'http://elcinema.tv/system/videos/1796/sd.flv';
$parts = explode('/', $url);
$id = $parts[count($parts)-2];

最好的方法是使用正则表达式,但我将把它留给正则表达式专家:)
$url = 'http://elcinema.tv/system/videos/1796/sd.flv';
$parts = explode('/', $url);
$id = $parts[count($parts)-2];