2013-02-24 115 views
0
$uri="https://www.facebook.com/video/embed?video_id=533502940004820"; 
$services['facebook']['regexp'] = array('/^https?:\/\/(www\.)?facebook\.com\/video\/embed?video_id=([0-9]*)/', 2); 
$services['facebook']['img'] = "https://graph.facebook.com/%s/picture"; 
$i=1; 

    $support=0; 
    foreach($services as $service => $s) { 
     if(preg_match($s['regexp'][0], $uri, $matches, PREG_OFFSET_CAPTURE) > 0) { 
      $support = $i; 
     } 
     $i++; 
    } 
    if($support==0){ 
     echo "This website doesn't support now!"; 
    } 

這是我的代碼,但是當我用https://www.facebook.com/video/embed?video_id=533502940004820搭配它,它不工作regexpression的網址無法正常運作

誰能告訴我這裏有什麼問題?

回答

1

embed?video代表「one or zero'd'」。你必須逃避它。