项目用到临时写的。待完善:
复制代码 代码如下:
/*
* 根据用户提交的(swf/html)地址,获取优酷,土豆的swf播放地址
* */
private function _getSwf ($url = ”) {
if(isset($url) && !empty($url)){
preg_match_all(‘/http:////(.*?)?/.(.*?)?/.com//(.*)/’,$url,$types);
}else{
return false;
}
$type = $types[2][0];
$domain = $types[1][0];
$isswf = strpos($types[3][0], ‘v.swf’) === false ? false : true;
$method = substr($types[3][0],0,1);
SyntaxHighlighter.highlight();