2013-10-11 40 views
-2
<?php 
include('simple_html_dom.php'); 
$htmls = file_get_html('src.html'); 

preg_match("/file:'(.+?)'/", $html, $matches); 
echo $matches[1]; 
    ?> 

我使用simple_html_dom.php從腳本獲取IMAGE,但它不工作。 在其他代碼工作。簡單的html DOM從腳本jwplayer代碼獲取圖像

<script type='text/javascript'> 
     var timer = 10; 
     var countdown; 

     var jwplplayerSetup = jwplayer('jw').setup({ 
     'modes': [ 
      {type: 'flash', src: 'http://www.myvideo.ge/flv_player/j/playerNew.swf'} 
     ], 

     'file': 'http://80.241.248.25/flv/216/2153964.mp4', 
     'image': 'http://thumbs2.myvideo.ge/screens/216/2153964.jpg', 
     'backcolor': '111111', 
     'frontcolor': 'cccccc', 
     'lightcolor': 'D10000', 
     'autostart': 'true', 
     'margin':0, 


      } 
     }, 
     }); 
     }); 
    </script> 
+3

由於E_DOESNT_WORK不是一個已知的PHP錯誤狀態,所以這個問題似乎是無關緊要的。 –

+0

'file'後缺少空格:'在你的模式中。再次詢問任何其他問題之前,請閱讀幫助中心。 :) – Leri

回答

1

文件屬性在其周圍有單引號('),冒號後有一個空格。你需要在正則表達式中解釋這些。以下行代碼適用於我:

preg_match(「/'file':'(。+?)'/」,$ html,$ matches);