例如http://elcinema.tv/system/videos/1796/sd.flv 我想知道什么是id - (1796)使用php
<div id="flowplayer" style="display: block; width: 620px; height: 465px;"></div>
<script type="text/javascript">
//<![CDATA[
flowplayer('flowplayer', "flowplayer-3.2.8.swf", {
clip: {
autoPlay: true,
autoBuffering: true,
onMetaData: function(clip) {
var w = parseInt(clip.metaData.width);
var h = parseInt(clip.metaData.height);
f = document.getElementById('flowplayer');
f.style.width ='620px';
f.style.height = '465px';
}
},
playlist: [
'http://elcinema.tv/system/videos/1796/sd.flv'
]
});
//]]>
</script>
答案 0 :(得分:2)
不需要regexp,试试这个:
$url = 'http://elcinema.tv/system/videos/1796/sd.flv';
$parts = explode('/', $url);
$id = $parts[count($parts)-2];